WordPress.org

Ready to get started?Download WordPress

Forums

SubHeading
[resolved] add subheading to postmeta (3 posts)

  1. Bob33
    Member
    Posted 2 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.

    thanks

    Bob

  2. Steve
    Member
    Posted 2 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. Bob33
    Member
    Posted 2 years ago #

    Steve,

    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

About this Topic

Tags