Archived topic
Insert an item at the end of the articles
7 replies · Started by Daniele on June 18, 2019
Hi, through the elements-hook function, it is possible to insert a code in all the articles, before the beginning of the article, selecting "after-entry-header" .. I would like to be able to insert also another code, immediately after the end of the article, I have tried in every way but this is not possible. How can I create a custom hook
Thanks, Daniele.
Hi there,
Not quite sure if I fully understand.
Are we talking about single posts?
https://docs.generatepress.com/article/hooks-visual-guide/#single-post
What code are you trying to insert?
Hi Leo,
yes, single posts, I would like to insert a banner, through a css code, immediately after the end of the article. not after the main, but inside, under the gallery of images that I insert at the end of the articles .. but I have tested all the predefined positions, but the one I want is not present ..
What about after_entry_content?
https://generatepress.com/forums/topic/photo-as-element-below-page/#post-932561
Thanks Leo, I tried how you suggested, it works, but the content is inserted at the bottom, after the links to categories and tags, I would like it to be inserted immediately after the article, at the end of the text. Before linking to categories and tags .. but maybe I ask too much, in this case I will insert the code in each article, in the exact position :)
Hi there,
if you use the generate_after_entry_content hook as Leo suggests then reduce the Priority to zero it will display before the footer meta.
Hi David, thank you, I set the priority to 0 and now it positions itself right where I want! Your theme is really great, and also your assistance .. thank you 1000 !!!
Daniele
Glad we could be of help - and happy to hear you're enjoying the theme