Support » Plugin: SubHeading » add subheading to postmeta

  • Resolved BobFest


    Hi Steve,

    I’m trying to add the_subheading to the postmeta in a thematic child theme using the built in override:

    function  childtheme_override_postheader_postmeta() {
    	if (is_single() || is_page())
    	    $postmeta = the_subheading('<p>', '</p>');
    return $postmeta;

    (this is simplified but shows the gist of it)

    This inserts the subheading text immediately before the h1 post title, which is mystifying me a bit. Same thing happens if I try to filter the post title.

    I could reposition it using css but not really ideal in terms of HTML flow.

    I know the override is working fine as when I use a simple text string, it sits nicely under the title where it should be. So it obviously has something to do with the_subheading('<p>', '</p>')

    I’ve had a look at the plug-in code but my PHP skills are still in the cut, paste & tweak novice range, so while I can kind of make out what’s going on, I can’t see what else I should try.

    Would appreciate any pointers. Great plugin btw.



Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Bob,

    It’s been a while since I last looked at this plugin, however I think it should be an easy adjustment.

    By default the_subheading() function will echo the value, but if you pass a third parameter of false, the value should be returned instead. Try changing it to the following:

    $postmeta = the_subheading('<p>', '</p>', false);

    – Steve


    That did the trick. Love it when there’s a simple solution!

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add subheading to postmeta’ is closed to new replies.