How can I switch using a page_id?
-
Hi there,
Using Code Snippets and Conditional Themes I expected I could switch themes using the following:// Switch to Twenty Sixteen theme when we being on page_id.
Conditional_Themes_Manager::register( ‘twentyten’, function() {
$id = get_the_ID();
return ( $id== “153”);
} );Other switches does work ,like
// Switch to Twenty Sixteen theme when we being on 2015.
Conditional_Themes_Manager::register( ‘twentyten’, function() {
return ( date( ‘Y’ ) == 2015 );
} );
But the switch based on the page id does not.
How can I get this to work properly?
I also tried with code like
global $wp_query;
$postID = $wp_query->post->ID;
return ( $postID == 153 );
but it does not seems to listen to me ??
- The topic ‘How can I switch using a page_id?’ is closed to new replies.