Hi,I'm converting a blog from Sandbox to thematic and wanting to use the subheading plug-in (http://wordpress.org/extend/plugins/subheading/) which requires this code in the template where the subheading goes:
if (function_exists('the_subheading')) { the_subheading('<p>', '</p>'); }
This was pretty straight forward in Sandbox by inserting in template.
So I'm working towards filtering the thematic posttitle function but getting bogged down in the finer details.
I have this so far:
function childtheme_override_postheader_posttitle() {
if (is_single() || is_page() && (function_exists('the_subheading'))) {
$posttitle = '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
$posttitle .= the_subheading('<p class="subh">', '</p>');
} elseif (is_404()) {
$posttitle = '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
} else {
$posttitle = '<h2 class="entry-title"><a href="';
$posttitle .= apply_filters('the_permalink', 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','childtheme_override_postheader_posttitle');
which is not throwing up any errors, just not working.
Tried previous filtering the postmeta with something like this:
if(function_exists('the_subheading')) {
$postmeta = '<div class="entry-meta">';
$postmeta .= the_subheading('<p class="subh">', '</p>');
$postmeta .= thematic_postmeta_entrydate();
$postmeta .= thematic_postmeta_editlink();
$postmeta .= "</div><!-- .entry-meta -->\n";
}
with some success but for some reason wasn't ending up in the div.
Pretty sure I'm missing some basic stuff :|
I'm quite keen to get my head around the workings of the code but not sure where to look for info.
for instance what does this little baby do:
\n
...and what is the difference between
= and .=
Can someone point me to a resource where I can nut out those kinds of things?
Any comments on the filter are also welcome.
Enjoying thematic & exploring the forum
Thanks