• Resolved magicalwonders

    (@magicalwonders)


    Hi Folks,

    I’m just wondering what is the recommended way of getting certain links such as “Privacy Policy” and “Contact Us” to display in the footer instead of the main navigation menu in header or sidebar?

    I’ve come across this code in the codex which shows how to exlude specific nav links from showing. –

    <ul>
    <?php wp_list_pages('exclude=17,38' ); ?>
    </ul>

    Would I just use this and then hand code the excluded links in the footer.php?

    Hope someone can advise if I’m on the right track.

    Many thanks,

    Myles

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello magicalwonders,

    Yes, that’s exactly what I would do. Use the wp_list_pages for the header navigation, excluding the two pages, and hardcode the other two links in the footer.

    Thread Starter magicalwonders

    (@magicalwonders)

    I forgot to mention that I’m currently using the following code, in order to control the page order. –

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

    Not sure how to merge the “exclude ” code.

    Would this be correct –
    <?php wp_list_pages(‘sort_column=menu_order&title_li=exclude=17,38’); ?>

    Myles

    <?php wp_list_pages('sort_column=menu_order&title_li=&exclude=17,38'); ?>

    I believe the only correction is putting the ‘&’ in before exclude. Try that out and see if it works. ??

    Thread Starter magicalwonders

    (@magicalwonders)

    Hi phpprincess,

    Many thanks for the help. I’ll give that a go.

    Best wishes,

    Myles

    Instead of hard-coding the footer links, include them in the footer:

    <ul>
    <?php wp_list_pages('sort_column=menu_order&title_li=&include=17,38'); ?>
    </ul>

    – Tim

    Thread Starter magicalwonders

    (@magicalwonders)

    Thanks for the advice Tim.

    Best wishes,

    Myles

    Use Page Mash plug-in to exclude pages from showing then hand code page to footer or else

    Thread Starter magicalwonders

    (@magicalwonders)

    Thanks for the recommendation of Page Mash.

    Many thanks,

    Myles

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Excluding pages from navigation menu’ is closed to new replies.