Site logo

Archived topic

Add Custom Navigation to Posts (Single)

3 replies · Started by Christopher on October 6, 2020

Viewing posts 1–4 of 4

Hi, all.

I've got a small website where we post newsletters about once a quarter. What I'd like to do is add a custom navigation at the bottom of the post, where it takes people back to the home page. I have no need for "previous" or "next" posts...just a simple "return to home" link.

I've seen code snippets and have been successful with getting "previous" links on there, but I am not versed in editing that function / add_filter code snippet, to get back to the home page.

Any help would be greatly appreciated. Thank you!

edit: wording

Hi there,

you can use the Hook Element:

https://docs.generatepress.com/article/hooks-element-overview/

Create a new Hook in Appearance > Elements.
Add your HTML for the link in the content:

<a href="your-home-page-url">Return to home</a>

Select the generate_after_content hook
Set the Display rules to Posts > All Posts.

You can also do this with the Block Element if you want to use blocks instead of HTML:

https://docs.generatepress.com/article/block-element-overview/

Thank you! Amazing.

Glad to be of help

This archived topic is closed to new replies.