WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Subheading] Need PHP help to show sub-heading as italic (4 posts)

  1. ronald_123
    Member
    Posted 1 year ago #

    I've installed the Subheading plugin and it is working fine.

    However, I want the subheading to show up in italic. But I'm unable to do so.

    Here's the code I am adding to single.php:

    $subhead = the_subheading();
    echo "<i>".$subhead."</i>";

    The subheading is showing up in the intended place but it is appearing as normal text, not in italic.

    How will I address the issue? Any help would be much appreciated.

    http://wordpress.org/extend/plugins/subheading/

  2. Rajan V
    Member
    Posted 1 year ago #

    Hi.,

    Try to this code

    $subhead = get_the_subheading();
    echo "<em>".$subhead."</em>";
  3. Steve
    Member
    Posted 1 year ago #

    Hi,

    Apologies for posting so long after the original thread was started.

    For future reference, although the above code will work, it is better / easier to use the before and after parameters instead:

    the_subheading( '<i>', '</i>' );

    This would output "<i>SubHeading content</i>".

  4. ronald_123
    Member
    Posted 1 year ago #

    Thank you @Rajan, @Steve.

Topic Closed

This topic has been closed to new replies.

About this Topic