Problem with template_include and body_class
-
I’m using the filter of template_include :
add_filter( 'template_include', 'custom_template'); function custom_template( $template ) { if ( is_page( 66 ) ) { $template = get_query_template( 'template-test' ); } return $template; }
Everything work fine outside the fact I dont get the class “page-template-template-test.php” in the body class. I instead get “page-template-default”
From what I understand, template_include is called after the body tag so body_class dosent get to work with the new template. Is it normal?
Am I using the function properly?
Thank
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problem with template_include and body_class’ is closed to new replies.