WordPress.org

Ready to get started?Download WordPress

Forums

How to hide PAGES (9 posts)

  1. archshrk
    Member
    Posted 9 years ago #

    I created several pages (vs. posts) that I do not want to show up in my Pages list (side bar) the sidebar currently codes...
    <li id="pages"><h2><?php _e('pages'); ?></h2>

    <?php wp_list_pages ('sort_column=post_name&title_li=') ?>

    If i replace it with this...

    <?php wp_list_pages('exclude=2,17&title_li=<h2>' . __('Pages') . '</h2>' ); ?>

    I get the same result. I only want to show the parent page and let the others be links within the page. http://www.serving-sandiego.com is the site in question.

  2. archshrk
    Member
    Posted 9 years ago #

    I tried following these instructions http://codex.wordpress.org/Template_Tags/wp_list_pages

    and read this post... http://wordpress.org/support/topic/20654#post-117694 but I still keep getting the full list.

    WAIT! I excluded the parant page and all subpages disapeared. Is there a different code for subpages?

  3. TechGnome
    Moderator
    Posted 9 years ago #

    So, is all you want is just the parent pages?
    IF so, then the parameter you want to set is "depth" -- set it to 1 and it will only show parent pages.

    Tg

  4. archshrk
    Member
    Posted 9 years ago #

    Yes, that is what I want. THANKS
    FYI - works like this...
    <?php wp_list_pages('depth=1sort_column=post_name&title_li=<h2>' . __('Pages') . '</h2>' ); ?>

  5. Torvon
    Member
    Posted 9 years ago #

    How can I exclude *special* pages?

  6. Jinsan
    Member
    Posted 9 years ago #

    what do you define as special pages?

  7. Torvon
    Member
    Posted 9 years ago #

    Not all, only some :-).
    I found this thread
    http://wordpress.org/support/topic/25441
    but it does not work proper for my blog. :-(

  8. lizziepants
    Member
    Posted 8 years ago #

    Yes, that is what I want. THANKS
    FYI - works like this...
    <?php wp_list_pages('depth=1sort_column=post_name&title_li=<h2>' . __('Pages') . '</h2>' ); ?>

    Where exactly do you alter this code?

  9. vkaryl
    Member
    Posted 8 years ago #

    In the sidebar.php file usually....

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.