Archived topic
Code insert in Body
7 replies · Started by Zipeng on February 27, 2019
There is an ad code needs to be placed in the page body.
Which part of GP hook are belong to body?
After header?
Don't want to edit the php file of the theme.
Thanks,
Hi there,
I believe this is the one you are looking for:
https://docs.generatepress.com/article/generate_before_header/
Let me know :)
My code need to insert in <body></body>
Are you sure?
Hi there,
the before_header hook is the first hook within the body, it comes immediately after the opening <body> tag.
I see.
Thanks.
You're welcome
Hi David,
Is there a way to insert a hook inside the body of a post, but after body content?
Something like:
Post TITLE
POST CONTENT
HOOK (with standard TEXT added via a hook, 'inside' the standard post content text)
Footer content
For context, we have a piece of text/html we would like to add to the bottom of every post on our website -- but we want it to appear in the body so that it is sent into our RSS feed.
I'm thinking it might be:
generate_after_main_content ?
I'm sorry if this is a silly question or outside the scope here but it seems relevant. We want to do this without using the single.php file if we can.
Cheers!
Hi there,
you can try the generate_after_entry_content hook with a priority of 1
This will place it before the footer post meta