WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] The Loop and subpages

[Resolved] The Loop and subpages

  • henkblanken
    Member

    @henkblanken

    I want to use The Loop to get not a certain page (you can do that with is_page() ) but a couple of childpages. This is the code, and it’s not working:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php if ( is_page(‘child_of=7’) ) : ?>
    <?php the_title(); ?>
    <?php the_excerpt(); ?>
    <?php else: ?>
    Sorry
    <?php
    endif; ?>

    <?php endwhile; else: ?>
    <?php _e(‘Sorry, no posts matched your criteria.’); ?>
    <?php endif; ?>

    (PS: 7 is the id of the parent page)

    Is this not supposed to work? Should I do something less stupid? Thnx

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] The Loop and subpages’ is closed to new replies.