• Resolved opialm

    (@opialm)


    Hi, would it be possible to add new condition to show the menu on password protected pages?

    Thanks a lot for this plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author themifyme

    (@themifyme)

    Hi,

    Unfortunately we do not have the condition for password protected pages, but you can set the condition for the Page you password protected, so it should work for that particular page ( or pages, as you can select multiple pages for 1 Conditional Menu ).

    Thread Starter opialm

    (@opialm)

    In the end used this, maybe will be helpful to someone:

    function my_wp_nav_menu_args( $args = '' ) {
    	$args['menu'] = 'menu1';
    
    	$post = get_post();
    	if(!post_password_required() && !empty($post->post_password)){
    		$args['menu'] = 'menu2';
    	}
    	return $args;
    }
    add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
    • This reply was modified 3 years, 7 months ago by opialm.
    • This reply was modified 3 years, 7 months ago by opialm.
    Plugin Author themifyme

    (@themifyme)

    Hi,

    Thank you for sharing the code you’ve used. If you need help with anything else, please open a new topic, so we can help you there.

    Have a good day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘new condition: password protected pages’ is closed to new replies.