Forums

How I can exclude my own page from menu (9 posts)

  1. luizaquino
    Member
    Posted 1 year ago #

    I used exclude the own page of the menu with wp_page_menu function

    'exclude' => 'my own page'

    <?php $args = array(
    	'sort_column' => 'menu_order, post_title',
    	'menu_class'  => 'menu',
    	'include'     => '',
    	'exclude'     => '',
    	'echo'        => true,
    	'show_home'   => false,
    	'link_before' => '',
    	'link_after'  => '' );
    ?

    How I can do the same thing with wp_nav_menu ??

    I am creating one menu to each page without the own page, but this is insane, because sometimes I have a lot pages to create.

  2. Chip Bennett
    Member
    Posted 1 year ago #

    Are you trying to exclude a page from the wp_nav_menu() output, or from its callback function?

  3. luizaquino
    Member
    Posted 1 year ago #

    wp_nav_menu output, I don't like that show on the menu the same page where the user are.

  4. Chip Bennett
    Member
    Posted 1 year ago #

    The wp_nav_menu() output is determined wholly by the user, who creates a menu and then assigns a menu to a Menu Location.

  5. luizaquino
    Member
    Posted 1 year ago #

    Hi Bennett, I understand this, but the problem is I don't know how to do only one Menu to all pages, and the same menu to exclude the own page when the user access it.

    This is possible? Maybe with some conditional tags?

    I have a lot pages and child pages and I am doing one menu for each them, this is crazy.

  6. jdy68
    Member
    Posted 7 months ago #

    Hi Luizaquino,
    Have you found a solution with conditional tags or not?
    I would make the same exclusion.

    Thanks

  7. samfusion
    Member
    Posted 7 months ago #

  8. jdy68
    Member
    Posted 7 months ago #

    Hi samfusion,

    I already use this plug-in for another goal but I would exclude to the menu the link of the current page displayed.

    Example, in my menu I have :
    item 1
    item 2
    item 3
    and when the page item 2 is displayed the menu will be :
    item 1
    item 3

    I'm using wp_nav_menu() with several menus: a menu in header, and two menus in sidebar.

    The plug-in exclude-pages excludes pages in all menus.
    How can I do?

  9. samfusion
    Member
    Posted 7 months ago #

    http://wordpress.org/extend/plugins/wp-main-menu/

    With WP Main Menu you can create a great menu with links to categories, pages, posts, tags and more for WordPress.

    Create as much as menu you want and place them wherever you wish with excluding pages.

Topic Closed

This topic has been closed to new replies.

About this Topic