Archived topic
Reusable Block - GP Hook
5 replies · Started by Jatin on August 27, 2021
Hi Guys,
I have created a Reusable block which i want to place at the end of every post. I was trying using GP Hook. But not sure how can i acheive it.
can you please let me know what should in the hook block to make sure this reusable block can be added to Single Post End.
Hi there,
It's possible to put a reusable block on the contents of a Block Element and then hook the Block Element to after_content Hook.
And then set the display rule location to "Posts - All posts" so it is only shown on single posts page.
Thanks, Can you please advice what code to incude and how to create it.
I can create a hook element and apply it where necessary as I had other hooks working as well but I wanted to know which code to include to use the reusable block ?
Hi there,
Why not just use a Block Element ? Then you can add whatever block based content to the required hook.
Thanks David, it works fine. But I have a query. Currently i have selected the Hook to generate after the content which hooks the elemant after social share buttons and also after related posts.
Ideally i want it to be before share this, that means after the blog content. Is there any hook i can use for this.
example link is in the private box.
How are the social share and related posts being added ? Are they a plugin that is automatically inserting them?
If so, check the plugins options to see if they provide a Shortcode method for displaying them, and then add those shortcodes in your Block Element below the content.