Forums

[resolved] Hiding a page from navigation bar but not making it private? (5 posts)

  1. threethings
    Member
    Posted 2 weeks ago #

    I want to make a page and link it on another page. But If I do this I'll have a billion pages on the nav bar. However, if I make it private, it says "Private: PAGE TITLE."
    Is there another way to do this? Thanks!

  2. equaldesign
    Member
    Posted 2 weeks ago #

    In your themes header.php file (probably without seeing your theme) you will find code similar to the following:
    <?php wp_list_pages(title_li=&depth=1'); ?>
    Add an include function to include only the page IDs that you want to show in the navbar, like this:
    <?php wp_list_pages(title_li=&depth=1&include=1,2,3,4,5'); ?>
    This will only include pages with IDs 1,2,3,4 and 5 in the navbar that lists your pages.

  3. threethings
    Member
    Posted 2 weeks ago #

    If I add that, and go to the site itself, it says "Unexpected "<" or "?" in header.php on line (Where I put it, 35 or 37.)" It's not reconizing that line.
    Do I take out the existing line, or add this one somewhere else?
    Here's what the existing code looks like:

    <?php
    			$custom_page_links = wp_list_pages('sort_column=menu_order&depth=1&title_li=&echo=0');
    
    			$custom_page_links = str_replace("<a href", " | <a href", $custom_page_links);

    The theme is Afterland. Here's the site.
    http://thehungergamestribute.co.cc/

  4. songdogtech
    Member
    Posted 2 weeks ago #

    You can use Exclude Pages « WordPress Plugins rather than modify theme code.

  5. threethings
    Member
    Posted 2 weeks ago #

    Well, that was easy. Thanks!

Reply

You must log in to post.

About this Topic