wp_query which gives only main pages (2 posts)

  1. kingHairness
    Posted 6 years ago #

    hello …

    im building some navigation an need a loop for that …
    i think that a good option would be to use the wp_query loop …
    linke this kinda
    (<?php $page_query = new WP_Query('post_type=page'); ?>
    <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>)

    but i dont know how to put it that i only get MAIN PAGES?

    any ideas

    thanks so far

  2. karl19
    Posted 6 years ago #

    Might be easier to use wp_list_pages if you're after a standard menu. You can define depth, exclude/include specific pages etc.

Topic Closed

This topic has been closed to new replies.

About this Topic