When you want to display all the child pages title and excerpt of current parent page then you can display by adding following code in your page template file
<?php
$child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?>
<?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild ); ?>
<h2 class="subpagetitle"><a href="<?php echo get_permalink($pageChild->ID); ?>" rel="bookmark" title="<?php echo $pageChild->post_title; ?>"><?php echo $pageChild->post_title; ?></a></h2>
/* And if you want to get the custom field values then you can get that by */
$your_custom_field = get_post_meta($pageChild->ID, 'your_custom_field', $single = true);
<?php the_excerpt();?>
<?php endforeach; endif;
?>
If you don’t want to display child pages on every page then you can use WordPress Conditional Tags.









December 22nd, 2009












How can I use de plugin? It’s activated and options ok… but it dón’t see what’s the code to insert in a post [/code]
@Juanjo
Sorry right now there are no short-codes available to insert the slideshow in the post page or widget area.
If you want to display the slidee in your theme then you have to add this code.
in your theme .php files where you want to show that slider.
I have used News ticker. But my boss want to display a page that contain all the post from new ticker. Is it possible?
Hi
First of all great plugin very decent style and different from others as well.
I have placed on my website and its working fine but my top navigation’s dropdown not working with this plugin.. I’m using this plugin for page navigation WP-PageNavi.
Is there anything can i do and it will fix ?
It has been solved. actually there was already called jquery in the header and this plugin calling it self another jquery file which is conflicting with each other. Just removed the plugin file and its working fine
Thank you that’s really helped me out. I was struggling with http://wpguru.co.za/templates/page/display-title-excerpt-of-child-pages/ but this worked a treat!
I can activate the plug-in however, when I go to save the settings I am getting a 500 Internal Server error… any ideas?
Hey there, this worked great for me.
Any chance you could share how we can access custom fields within the loop?
@Michael Caputo
Use
within the loop to get the custom field values.
Thanks for responding so quickly!
I’ve got the custom fields working, now i’m trying to get the links to the sub pages working. the
doesn’t seem to want to link to the sub page.. Any help?
Got it
Where are the screenshots? I can’t see them..
I setup the code on my page template file. It works, but the thumbnail is of the parent page and not of the child pages. How can I display the child page thumbnails next to the child page excerpt.
Hey, great snippet! Is there a way that this line `$pageChild->guid` can be changed to respect the Permalink settings. Currently it gives out the raw link, not a pretty one. Thanks!
Yes Replace
with
I edited that in post now….
Awesome trick, but is there a way we can get the child page’s image? I’ve been trying with , but all I get is a repeated display of my current page’s image.
Thanks again.
Hi!
Thx for this code.
But.. i got one problem.. when have more than 1 level of sub-pages, the excerpt that show is of the first child page. Ex:
- Top page
- – Child 1
- – - Child Child 1
- – - – Child Child Child 1
At the second level, instead shows the excerpt of “Child Child Child 1″, shows the “Child 1″ Excerpt.
Got it? Anyway to solve this problem?
Thanks
finally everything is ok..
i changed
by
post_excerpt;?>
thanks for posting this, just what I needed!
just have to work out how to show the image in miniature using custom fields now.
Fantastic script. Ty. After way to many hours yours works. Can you show a beginner how to fine tune the code to add the pic and maybe create a link from the title to the full page? Again thank you for helping make better blogs for all