Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #380059

    I am trying to change the wp_nav_menu based on the current post_type displaying.
    But i cant do it without changing the core files. includes/helper-main-menu.php
    an apply_filters would be nice in the next update :)

    i changed line 123:
    'theme_location' => apply_filters( 'avia_wp_nav_main_menu', $avia_theme_location ),

    functions.php

    add_filter( 'avia_wp_nav_main_menu', 'test_nav' );
    
     function test_nav()
     {
    		global $post;
    		
    		if( $post->post_type == 'showcase' )
    			return 'showcase-menu';
    		else
    			return 'avia';
     }
    • This topic was modified 9 years, 9 months ago by eaonflux.
    #380063

    Hi eaonflux!

    Please try using this plugin – https://wordpress.org/plugins/zen-menu-logic/
    Cheers!
    Yigit

    #380114

    Thanks for your quick response.
    But mine main rule is to use less plug-ins as possible.

    but i will analyze that plug-in, maybe i can borrow some code from it so i dont have to change the core files with each update.

    Greets,

    eaonflux

    p.s. but an apply_filters is still appreciated ;)

    #380617

    Hi!

    Thank you for using Enfold.

    Try to use this plugin then use the is_singular() conditonal function: https://wordpress.org/plugins/menu-items-visibility-control/

    Cheers!
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.