Um die Unterseiten der aktuellen Seite aufzulisten kann folgender Schnipsel verwendet werden. Dieser ist z.B. in einem Custom Page Template sinnvoll.
<!-- Liste der Unterseiten -->
<?php
global $wp_query;
if($post->post_type == 'page'){
$current=$post->ID;
}
if( empty($wp_query->post->post_parent) ) {
$parent = $wp_query->post->ID;
} else {
$parent = $wp_query->post->post_parent;
}
echo'<ul class="related">';
wp_list_pages("exclude=$current&title_li=&child_of=$parent");
echo'</ul>';
?>
Eine ergänzende Lösung mit Beitragsbild Thumbnail und Excerpt (auf Standard PHP Basis)
<!-- Liste der Unterseiten -->
<div id="subpages">
<?php $mo_subpages = get_pages(array('child_of'=> $post->ID, 'hierarchical' => 0, 'parent' => $post->ID));
if ( $mo_subpages ) {
foreach ( $mo_subpages as $mo_Subpage ) { ?>
<a class="subpage" href="<?php echo get_permalink($mo_Subpage->ID);?>">
<article id="post-<?php the_ID(); ?>">
<div class="subpage-thumbnail">
<?php if (has_post_thumbnail($mo_Subpage->ID)) {
echo get_the_post_thumbnail($mo_Subpage->ID, '75x75');
} ?>
</div>
<div class="subpage-container">
<header class="subpage-header">
<h2 class="subpage-title">
<?php echo $mo_Subpage->post_title ?>
</h2>
</header>
<div class="subpage-excerpt">
<?php
$page_id = $mo_Subpage->ID;
$page_object = get_page( $page_id );
$subpage_excerpt = $page_object->post_content;
if(strlen($subpage_excerpt) >= 100) {
$subpage_excerpt = wordwrap($subpage_excerpt,100);
$subpage_excerpt = substr($subpage_excerpt,0,strpos($subpage_excerpt,"\n")).'...'; //bei Zeilenumbruch Text abschneinden
} ?>
<p><?php echo $subpage_excerpt; ?></p>
</div>
</div>
<div class="clearleft"></div>
</article>
</a>
<?php }
} ?>
</div>
essay architecture
05.06.2020, 2:03 Uhr
My brother recommended I would possibly like this website.
He was once totally right. This publish actually made my day.
You can not imagine just how a lot time I had spent for
this information! Thank you!