WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to Exclude Page from Menu Yet Have it Appear Frontpage Static? (6 posts)

  1. eddyj
    Member
    Posted 4 years ago #

    Hi, I have created a site

    http://www.beheardantibullying.info/

    The menu navigation at the top are all Pages

    Now ive created a page called Help Now and in settings>reading set it as sticky frontpage

    I dont want it to appear as an item on the menu bar is there a way to exclude a page yet still have it appear as your frontpage static?

    thanks

  2. MichaelH
    Member
    Posted 4 years ago #

    Look at using the template tag, wp_list_pages(), and the exclude= argument.

  3. eddyj
    Member
    Posted 4 years ago #

    Hi MichaelH thankyou I will go do that now and update you on how things go

  4. eddyj
    Member
    Posted 4 years ago #

    It worked, thankyou my friend.

    Just for other peoples benefit. Basically you have to go into editor find the .php file probably header.php and then the part which says

    <?php $exclude = obwp_get_meta(SHORTNAME.'_exclude_page'); wp_list_pages2('title_li=&sort_column=menu_order&depth=0&exclude=X'.$exclude) ?>

    Now where i have put X is what you change for the number of the page

    to find the number of the page go to pages and mouse over the page link and you will see it

  5. xtra
    Member
    Posted 4 years ago #

    HI Eddy, what if I have three pages I would like to exclude? how do I write it correctly? I dont know php

  6. xtra
    Member
    Posted 4 years ago #

    Here is the code that worked a treat:

    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&exclude=232,263'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic