Archived topic
Elements/Hook
5 replies · Started by Don on April 4, 2023
I have a block hook displaying an ad before_entry_title, it works fine, but when I try to change the location I get this error: The "generatepress-block-element" plugin has encountered an error and cannot be rendered.
Thanks
Don
Hi Don,
That sounds weird as the generatepress-block-element is not a plugin.
Can you try disabling all plugins except GP Premium and the plugin that you are using in the block element to test?
Let me know!
Hi Ying,
I restarted my computer and now I am able to reposition the ad, should of tried that before asking for help! One other question, I see in the "Hooks Visual Guide" different areas to "hook" into. However, is there a way to "hook" an ad into an area within the post? For example, after the second paragraph or before the fifth paragraph?
Thanks
Don
Hi there,
Hooks are in the themes ( or WP or Plugins ) code. So they don't exist in your content.
You can use some PHP and the the_content filter hook to inject stuff after an element. And we have some examples here.
But for convenience i would recommend this plugin:
https://wordpress.org/plugins/ad-inserter/
Note, its not just for ads...
Thank You!
You're welcome