WordPress.org

Ready to get started?Download WordPress

Forums

Sub pages menu (1 post)

  1. dennislynge
    Member
    Posted 4 years ago #

    Hey,

    I'm using this php code and it works fine

    <?php
    $parent_id = $posts[0]->ID;
    $args=array(
    'post_parent' => $parent_id,
    'post_type' => 'page',
    'post_status' => 'publish',
    'posts_per_page' => -1,
    'caller_get_posts'=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
    echo 'List of Posts';
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <p>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></p>
    <?php
    endwhile;
    }
    wp_reset_query(); // Restore global post data stomped by the_post().
    ?>

    The problem is that I can't figure out how to keep the menu when I am on the sub page. I hope someone can help me.

    http://www.dennislynge.dk/clients/poesienshus/?page_id=2

Topic Closed

This topic has been closed to new replies.

About this Topic