• Resolved threethings

    (@threethings)


    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • equaldesign

    (@equaldesign)

    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.

    Thread Starter threethings

    (@threethings)

    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.
    https://thehungergamestribute.co.cc/

    Mark Ratledge

    (@songdogtech)

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

    Thread Starter threethings

    (@threethings)

    Well, that was easy. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hiding a page from navigation bar but not making it private?’ is closed to new replies.