[resolved] add subheading to postmeta (3 posts)

  1. BobFest
    Posted 5 years ago #

    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.



  2. Steve
    Posted 5 years ago #

    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

  3. BobFest
    Posted 5 years ago #


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

    Many thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SubHeading
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic