vendredi 24 juin 2016

Hiding menu from specific pages but not recognising one of the pages I would like hidden?

So I am using the ShiftNav plugin to create a slide in menu that is only accessed in a members area. I am looking to hide this menu from the general pages such as the home, blog, contact etc and have managed to do so except it is not recognising one of the pages. I have checked the page id's of all the pages I would like hidden and have put them in an array in the child functions.php like this:

add_action( 'wp_head' , 'remove_shiftnav' );
function remove_shiftnav(){
    if( is_page(array(2212, 1400, 'blog', 1950, 33, 20, 2169, 2109, 6, 2, 2114, 2053,))){
        remove_action( 'wp_footer', 'shiftnav_direct_injection' );
    }
}

Page ID 1400 and 'blog' both represent the blog page but despite this code working for all of the other pages in the array, it isn't working for my blog page only and the menu still shows. Any ideas why this could be?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire