Site logo

Archived topic

Conflict between Content Template and after_content hook

3 replies · Started by Michel on February 14, 2022

Viewing posts 1–4 of 4

Hi,

Using GeneratePress and GenerateBlocks.

Is it possible that if you set up a Content Template for posts, any Element using the after_content hook stops displaying? It happened to me.

Tried to check the "keep original content container" option but that didn't work. Had to change the hook of those Elements to after_do_template_part for them to display. Which means having to reorder the post navigation, which uses the same hook, and reconsidering the use of after_content in other elements.

Is there an obvious fix to this, to avoid such workarounds and keep things orderly?

Hi there,

the after_content hook is part of the themes content template(s).
When you add a Block Element Content Template you're replacing the themes template. So that hook no longer exists.

You can either use the after_do_template_part or the after_main_content and set the Priority to re-order those elements. OR you need to combine all those elements into the Content Template.

As a note - the content template was originally designed around archive templates. We're working on some new additions that will make designing entire templates easier.

Thanks.

Additions to content templates would be great. I've already found a couple of things that can be better customised on a site with the existing material, so I imagine there is potential to unlock.

The future update will allow you to replace the entire Template not just the Content template part, so you can effectively build the whole page, sidebars and all .... :)

Glad to be of help.

This archived topic is closed to new replies.