Archived topic
Feature Request: Mid-post element hook + (more)
10 replies · Started by Benjamin on July 31, 2021
Hi guys, I am a huge fan of the GP Theme and I'm using it on all my sites and will continue to do so for many more years probably.
I have a feature request that I would like to see implemented and that would be quite useful for myself and I'm sure others will find it useful as well as I've seen topics about this in support tickets before.
I was wondering if you guys could possibly add some more hook options for elements on posts like a mid-post hook and maybe say a hook for after the 3rd or 5th paragraph and before say the 3rd or 5th last paragraph for an end of posts element hook.
This would be quite useful for creating email signup forms in posts, ads, CTAs, etc.
Just a thought- maybe this is something you can implement in the future (would be awesome)!
Thanks- love the theme- take care!
Hi Benjamin,
This is difficult unfortunately. Here is the answer from Tom:
Hooks cannot be added inside the content since it's just static content. We would have to filter the_content which isn't something elements can do, at least not right now.
Alright, thanks- if it's ever possible then. Take care.
No problem :)
Hi guys, I was thinking about this for a while. I recently came across an interesting approach on another theme I'm using on one of my websites and wanted to let you know so that you can potentially incorporate it into GP. The theme inserts a mid-post offer automatically after the 5th H2 heading, but it can be manually moved around in the article with a shortcode [offer], and the offer is customized separately. Would be interesting if you could create a hook called offer and then allow users to create an offer and then use a shortcode of type to display that offer in posts manually. (or automattically- you can make it like another GP Premium module that can be activated/ deactivated). Shouldn't be too hard to code it into the functions.php file. Not sure if it will drastically affect theme performance as that's what makes GP so attractive, but I doubt it.
Cheers! Let me know what you guys think.
updating status.
Hi there,
if you want to do something similar today then you can create your own shortcode that outputs your own custom hook - see here:
Sure thanks, will have a look.
Is there any talks of bringing something like this directly into GP?
Take care!
There has been some talk regarding a placeholder block for this kind of thing. But its not high on our list as the little bit of PHP provided above has worked quite well for the few users who have asked for something similar.
But its on our radar :)
Glad to be of help.
Sure thanks- would be amazing. Will have a look at the PHP then for now and let you know if I need more assistance.
Take care.
You're welcome