WordPress.org

Ready to get started?Download WordPress

Forums

Sub Pages (6 posts)

  1. ryanwordpress
    Member
    Posted 5 years ago #

    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.

  2. RoseCitySister
    Member
    Posted 5 years ago #

    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

  3. ryanwordpress
    Member
    Posted 5 years ago #

    Thank you. I fixed it with a Plug In.

  4. tonybanh.se
    Member
    Posted 4 years ago #

    what plugin did you use?
    thx

  5. studio868
    Member
    Posted 4 years ago #

    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

  6. riffard
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags