I would like to add content above page posttitles in my child theme.
I've been able to do an amazing amount of Thematic customization already -- for example, I understand how to remove and add functions -- however I haven't been able to find clear instructions for overriding filters in child themes.
I found the // Create post title filter code in content-extensions.php, and this is what I came up with. I only added the bcn if/else statement.
However, I'm *clearly* not fluent in PHP, so I created a white screen of death.
Is there anyone who can let me know if I'm moving in the right direction or not?
// Replace post title
add_action('init', 'remove_postheader_posttitle');
function my_thematic_postheader_posttitle($posttitle) {
if (is_single() || is_page()) {
if(function_exists('bcn_display')){
$posttitle = '<div class="breadcrumb">';
$posttitle .= bcn_display();
$posttitle .= '</div>';
$posttitle .= '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
} else {
$posttitle = '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
}
} elseif (is_404()) {
$posttitle = '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
} else {
$posttitle = '<h2 class="entry-title"><a href="';
$posttitle .= get_permalink();
$posttitle .= '" title="';
$posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');
$posttitle .= '" rel="bookmark">';
$posttitle .= get_the_title();
$posttitle .= "</a></h2>\n";
return $posttitle;
}
add_filter('thematic_postheader_posttitle', 'my_postheader_posttitle');
} // end Replace thematic_postheader_posttitle