WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] display parent + child-pages (2 posts)

  1. Franz Josef Kaiser
    Member
    Posted 5 years ago #

    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(); ?>
  2. MichaelH
    Member
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.