- This topic has 6 replies, 3 voices, and was last updated 3 years, 4 months ago by
Fernando.
-
AuthorPosts
-
December 21, 2022 at 4:32 pm #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.
December 21, 2022 at 5:19 pm #2469966Leo
StaffCustomer SupportHi 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_titlehook:
https://docs.generatepress.com/article/hooks-visual-guide/#single-postCheck the Execute PHP checkbox then set the hook priority to 5:
https://docs.generatepress.com/article/hooks-element-overview/#settingsLet me know if this helps 🙂
December 21, 2022 at 5:32 pm #2469981Matthew
It seems like it should have worked, but it didn’t…
This is what the site looks like now…
December 21, 2022 at 5:49 pm #2469992Fernando 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.
December 21, 2022 at 5:56 pm #2469996Matthew
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.
December 21, 2022 at 6:04 pm #2470000Matthew
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!
December 21, 2022 at 6:23 pm #2470008Fernando Customer Support
I see. Glad you resolved the issue! You’re welcome, Matthew!
-
AuthorPosts
- You must be logged in to reply to this topic.