Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //attempt creating a test child page function
- <?php function testchildren () {
- $children = get_pages('child_of='.$post->ID);
- if( count( $children ) != 0 ) {
- echo 'has NO children';
- return $nochildren;
- }
- else
- {
- echo 'has children';
- return $haschildren;
- }
- }
- ?>
- <!-- basic loop -->
- <?php if (have_posts()) : while (have_posts()) : the_post() ; ?>
- <h2>
- <?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?>
- </h2>
- <?php testchildren (); ?>
- <h1 style="margin-bottom:12px"><?php the_title(); ?></h1>
- <?php the_content(); ?>
- <?php endwhile; endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement