If Page
-
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
The topic ‘If Page’ is closed to new replies.