• Hey there! This plugin is great. it’s allowed me to create the menus i need based off of the preset conditions. I’ve rated it a 5 if that helps.

    I had a question for you, I’m trying to set a custom condition. I have a page with the slug “cap” and I’ve inserted the “is_page” conditional, but it does not seem to be working.

    I wonder if I’ve done anything wrong?

    Here is the code in my functions file:

    /* If Menu Conditions */
    add_filter( ‘if_menu_conditions’, ‘my_new_menu_conditions’ );

    function my_new_menu_conditions( $conditions ) {
    $conditions[] = array(
    ‘name’ => ‘If Page is Creative Accelerator Program’, // name of the condition
    ‘condition’ => function($item) { // callback – must return TRUE or FALSE
    return is_page( ‘cap’ );
    }
    );

    return $conditions;
    }

    Thanks for the plugin and your help.

    Cheers.

    Lewis

    https://wordpress.org/plugins/if-menu/

Viewing 1 replies (of 1 total)
  • Thread Starter Neefly

    (@neefly)

    Ah also, I wonder how difficult would it be to create another set of conditionals?

    For example if I wanted something to show on the Front Page AND Post Pages but hide on Pages.

Viewing 1 replies (of 1 total)
  • The topic ‘If Page’ is closed to new replies.