• I have a template that uses V2.65 and it won’t allow me to use sub pages. It puts them in the top line menu when I don’t want them to. Does anyone have any idea on how to get my theme to allow me to do this? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Your page list tag should look something like this:

    <?php wp_list_pages('sort=menu_order&depth=3&title_li='); ?>

    It is probably in header.php in your template directory.

    On edit: this is the page you should check out.

    http://codex.wordpress.org/Template_Tags/wp_list_pages

    Thread Starter ryanwordpress

    (@ryanwordpress)

    Thank you. I fixed it with a Plug In.

    what plugin did you use?
    thx

    I am having the same problem but my code is different.

    <!–begin pages–>
    <ul class=”pages”>
    <?php dp_list_pages();?>

    <!–end pages–>

    Why does my code use dp instead of wp?

    How can I eliminate the sub pages in the nav bar?

    I tried several plugins but none of them worked.
    My site is http://www.sanduskycountybuildersassociation.com

    Thanks for the help
    Andrea

    Andrea, here is how!

    I just figured out how to do it. This will allow you to exclude them, while ordering them however you want if that is your preference.

    Open up the “functions.php” file for the theme and replace the portion under
    “# Displays a list of pages”. It is located in your theme (/wp-content/themes/{name of your theme’s folder}/functions.php

    Replace:

    $querystr = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’ ORDER BY $wpdb->posts.post_title ASC”;

    With:

    $querystr = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’ ORDER BY $wpdb->posts.menu_order ASC”;

    It took me three days to find this, so I figure I’d share. WordPress does not have a great support system, so if you can pass this on, please do. Please copy and paste the link to this post to other inquiries.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sub Pages’ is closed to new replies.