Site logo

[Resolved] Adding subheading below post title

Home Forums Support [Resolved] Adding subheading below post title

Home Forums Support Adding subheading below post title

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2469940
    Matthew

    On TheDesk.net, I use a Subheading plugin: https://wordpress.org/plugins/subheading

    The Subheading plugin wants me to insert the following code wherever I want the subheading to display:

    <?php if (function_exists(‘the_subheading’)) { the_subheading(‘<p>’, ‘</p>’); } ?>

    On my old theme, I had the subheading appear below the title, but above the date and author line. On GeneratePress, I’m not seeing where in the theme editor I should add the PHP code to make it so the subheading appears below the title but above the date and author line.

    #2469966
    Leo
    Staff
    Customer Support

    Hi there,

    You can create a Hook Element to enter that line of PHP snippet:
    https://docs.generatepress.com/article/hooks-element-overview/

    Then select the after_entry_title hook:
    https://docs.generatepress.com/article/hooks-visual-guide/#single-post

    Check the Execute PHP checkbox then set the hook priority to 5:
    https://docs.generatepress.com/article/hooks-element-overview/#settings

    Let me know if this helps 🙂

    #2469981
    Matthew

    It seems like it should have worked, but it didn’t…

    This is what the site looks like now…

    https://imgur.com/Y6XodqV

    #2469992
    Fernando
    Customer Support

    For reference, what’s the sub-heading for this specific post in your screenshot?

    Can you try adding a static text to the Hook to first check if it’s adding?

    For example, add this in your Hook Element:

    <p>Sub-Heading</p>

    Let us know if it appears.

    #2469996
    Matthew

    The subheading should read:

    “A last-minute funding deal fell through, leaving the company in an extremely difficult position.”

    I added the <p> code but that didn’t do anything, either.

    #2470000
    Matthew

    Update: Got it to work. While the installation instructions suggested that particular line of PHP, the plugin itself actually suggested adding this to the hook:

    <?php the_subheading(); ?>

    …d’oh.

    Still, wouldn’t have thought to add it as a hook element in the first place, so thank you for your help!

    #2470008
    Fernando
    Customer Support

    I see. Glad you resolved the issue! You’re welcome, Matthew!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.