WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] display parent child-pages

[Resolved] display parent child-pages

  • Hi!

    I want to display on a static page with my templage:

    * one parent page (id=79) and then
    * all child-pages (under page_id=79) with query_posts …

    i can display all the child-pages, but the parent-page doesn´t appear. could you provide some help?

    <?php
    /*
    Template Name: LogIn
    Description: LogIn Aussteller
    */
    ?>
    
    <?php get_header(); ?>
    <?php query_posts('post_type=page&page_id=79&post_parent=79&order=asc'); ?>
    
    <div id="page">
        <div id="slider">
            <ul class="navigation">
    <?php while (have_posts()) : the_post(); ?>
                <li><a href="#<?=$post->post_name?>"><span><?php the_title(); ?></span></a></li>
    <?php endwhile;?>
            </ul>
    
            <div class="scrollButtons scrollMeLeft"><a><span>previous</span></a></div>
    
            <div class="scroll">
                <div class="scrollContainer">
    <?php while (have_posts()) : the_post(); ?>
                    <div class="panel" id="<?=$post->post_name?>">
                        <h3><?php the_title(); ?></h3>
                        <?php the_content(); ?>
                    </div>
    <?php endwhile;?>
                </div>
            </div>
    
            <div class="scrollButtons scrollMeRight"><a><span>next</span></a></div>
    
        </div>
    </div>
    
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
  • MichaelH

    @michaelh

    I think you would need two queries to do that, one for the parent, one for the children.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] display parent child-pages’ is closed to new replies.
Skip to toolbar