Hi buddies,
sorry to bother you again but the more I go into Thematic, the more I understand, the more I have unexpected results ;)
I've learned the existence of the filters. And that's so much fun, and so much good.
But there must be something wrong in my code, 'cause it doesn't wor properly. Could you help me understand, maybe?
What I want to do is to add post thumbnails and change a bit the order of the elements of the posttitle...
Here's my code:
function cm_postheader_posttitle() {
if (is_single() || is_page()) {
$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 = '<div class="testatapost">';
$posttitle .= the_post_thumbnail();
$posttitle .= '<a href="';
$posttitle .= get_permalink();
$posttitle .= '" title="';
$posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');
$posttitle .= '" rel="bookmark"><div class="entry-title">';
$posttitle .= '<h2>';
$posttitle .= get_the_title();
$posttitle .= '</h2><span class="entry-excerpt">';
$posttitle .= get_the_excerpt();
$posttitle .= "</span></div></a></div>\n";
}
}
add_filter('thematic_postheader_posttitle', 'cm_postheader_posttitle');
The problem is that, as a result, I get *only* the thumbnail image and nothing more (not even the
<div class="testatapost">
that is before the command to call the thumbnail.
Any idea?