- This topic has 4 replies, 3 voices, and was last updated 3 years, 4 months ago by
Fernando.
-
AuthorPosts
-
December 21, 2022 at 4:53 pm #2469956
Myles
I’m using the GP site “Explore” and noticed there is an existing Single Post Content Element.
Within that Single Post Content Element is an author box. Below that, I want to add a Call To Action box.
I know I can edit the already made Single Post Content Element to add another box below the author box, but I want to make the Call to Action box a separate hook element, so that I can decide which blog posts have both boxes (author and call to action) or just one box, the author box.
I tried creating a hook element but I can’t find a hook name that will insert the element right after the author box that was created using the Single Post Content Element.
Can you please assist?
December 21, 2022 at 5:17 pm #2469964Leo
StaffCustomer SupportHi Myles,
but I want to make the Call to Action box a separate hook element, so that I can decide which blog posts have both boxes (author and call to action) or just one box, the author box.
This won’t work with the current Single Post Content element unfortunately – the template removes all existing hooks.
I believe the best solution is to modify the Single Post Content to be Authorbox only:
1. Remove the Dynamic Content block:
https://www.screencast.com/t/FKG0lnvnv2. Duplicate the Container that holds the author box then drag it outside the container wrapper:
https://www.screencast.com/t/TmsHRjJfBEm3. Now you can remove the Container with the previous content and left with just the author box:
https://www.screencast.com/t/ksJWQPQc4. Change the Element Type to
Hookand Hook name toafter_entry_content:
https://www.screencast.com/t/RJ6eqJJXH7Z5. Then change the element name.
Then you can create a separate element using the same hook and control the order using priority:
https://youtu.be/VdoWGOsvDMkLet me know if this helps 🙂
December 21, 2022 at 6:12 pm #2470005Myles
Thanks, Leo. I should have made a copy of that template before deleting it as I realized it would completely change the layout of blog posts.
Is there any way to maintain the look of the single column blog post with a white background like in the GP Explore site without creating a template? I used Explore because I wanted that layout, but now it’s wiped out.
December 21, 2022 at 6:20 pm #2470006Myles
Also, just a follow up to my previous message, do you also have instructions on how to create the Single Post Content template that came with Explore?
December 21, 2022 at 6:57 pm #2470022Fernando Customer Support
Hi Myles,
Unfortunately, we don’t have step-by-step instructions readily available to share to create that page.
However, to answer your first question, it can be created without the use of a Block Element – Content Template.
You’ll need to create the Block Elements first.
Page Hero: https://docs.generatepress.com/article/block-element-page-hero/
Author Box: https://www.youtube.com/watch?v=4x6CjGOyagc
Post Navigation: https://docs.generatepress.com/article/block-element-post-navigation/You can then create a Layout Element for the Content Width. Reference: https://docs.generatepress.com/article/layout-element-overview/#content-1
The idea is to limit the width so that the content is smaller like it is in “Explore”. You can also disable the sidebar through the Layout Element.
Lastly, in Appearance > Customize > Colors, set the Background color to something off-white. Then, set the Content Background color to white.
-
AuthorPosts
- You must be logged in to reply to this topic.