• 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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Are you trying to exclude a page from the wp_nav_menu() output, or from its callback function?

    Thread Starter Luiz Aquino

    (@luizaquino)

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

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

    Thread Starter Luiz Aquino

    (@luizaquino)

    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.

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

    Thanks

    sam

    (@samfusion)

    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?

    sam

    (@samfusion)

    https://www.ads-software.com/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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How I can exclude my own page from menu’ is closed to new replies.