problem with conditional tags
-
I have a template file called home.php. I’m using the thematic theme and the home.php is in the child theme folder.
The thematic theme allows me to add content through action hooks… I made a widget area to be displayed only at the home page but when I use the conditional tag is_home(), it returns false but it returns TRUE for is_category() even though it’s being called in the home.php. Here’s my code
//create the widget area $args2 = array( 'name' => ('Below Content'), 'id' => 'child-below-content', 'description' => 'Widget area for content after index loop', 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title() ); register_sidebar($args2); //display the sidebar function child_belowcontent_aside() { if( is_home() ){ if (is_active_sidebar('child-below-content')) { echo thematic_before_widget_area('child-below-content'); dynamic_sidebar('child-below-content'); echo thematic_after_widget_area('child-below-content'); } } } add_action('thematic_belowcontent', 'child_belowcontent_aside');The sidebar displays fine without the conditional tags but I only need the sidebar to display in the home page.
I did a similar thing with the thematic_abovecontent() hook and it works perfectly, I took a gander at the thematic functions.php and they both work the same way except one is called befor the index loop and the other is called after the index loop
The topic ‘problem with conditional tags’ is closed to new replies.