Archived topic
Block element does not show up
5 replies · Started by Kris on December 28, 2022
I wanted to add custom content to individual post categories, using: Block element + hook, as you can see here:
https://1drv.ms/u/s!Ao_4GhwEwG2BgvoCq-z_O8Z1zAsn8g?e=e2o91u
However, it does not show up.
Also: it does not show up on main blog page, tags.
it does show up, when I choose single post, or page.
Have you sees something like this?
Thanks
Hi Kris,
The locationPost categorymeans the single posts which belong to a certain category.
In your case, use post category archive as the location.
Thank you.
It works, but not in all hooks.
When choosing hooks like: after_archive_title, after_archive_description (as it is described here for archive pages: https://docs.generatepress.com/article/hooks-visual-guide/) it does not show.
However, it shows when I choose inside_site_container.
I'm using INFO template from site library.
May it be that the use of theme specific template Elements for archive pages is causing that?
Hi Kris,
You're correct. Some hooks won't work when a Block Element - Loop Template is active on an Archive page.
It would be good to add whatever you're adding directly in the Block Element - Loop Template as well.
If you prefer not to do so, you can create a Portable hook. Example: https://generatepress.com/forums/topic/hooks-related-question/#post-2170598
Awesome. Thank you.
I was just thinking how to solve it with PHP, and your answer gives me what I need :)
You're welcome, Kris!
