Archived topic
Insertion just before the generate_after_content placeholder
5 replies · Started by Martin on November 17, 2021
Hello,
I would like to insert a text at the end of the article positioned right after the last text of the post.
The hook generate_after_content inserts this text after the author box and after the breadcrumbs, and while this is inside the "article", I would like to have it above the author box and above the breadcrumbs just as if it is part of the text of the article.
How can I do that placement through a hook or any other way, please?
Kind regards, Martin
Hi there,
how are the breadcrumbs and author box been added to the site ?
The author box is added through the Simple Author Box plugin. I do not mind to change it or replace it for a GeneratePress box if that exists.
The breadcrumb is an example shown in your visual guide. I do not use breadcrumbs.
Thank you, Martin
OK so first thing is to edit your hook and change the priority to 1
This will position it above the themes post meta/breadcrumb,
The author box - you can build one using a Block Element:
https://docs.generatepress.com/article/block-element-overview/
YT Video showing how:
https://youtu.be/Ni3KXdZ5Dl8
And this can be hooked in below the post meta using the same after_content hook.
Thank you David. I created the userbox and deactivated the original plugin, and I set the priorities so that the text is depicted in the article before the userbox as per my requirements.
I used the video you pointed me at https://www.youtube.com/watch?v=HMhUo91RjsE.
Glad to hear that!