What I'm trying to do it to create a wordpress child theme that uses the wordpress theme "Thematic" as its parent. The theme uses a functions.php file to which I can add little bits of code to alter the appearance of the pages. The theme should display the single post and pages as background-image:none, with all other areas of the theme displaying background-image: featured-image(). This latter part clearly doesn't work as CSS, hence the reason why I'm turning to PHP.
You can see my working so far here. My current conditional statement doesn't seem to work, always resorting to the else:
Code: Select all
if (is_single() || is_page()) {
echo "single post or page";
} else {
echo "post background is featured image";
}Code: Select all
<?php
// Remove default Thematic actions
function remove_thematic_actions() {
remove_action('thematic_header','thematic_access',9);
}
add_action('init','remove_thematic_actions');
add_action('thematic_aboveheader','thematic_access',9);
if (is_single() || is_page()) {
echo "single post or page";
} else {
echo "post background is featured image";
}
?>