Site logo

Archived topic

How hook block template to existing page

3 replies · Started by Radek on October 6, 2021

Viewing posts 1–4 of 4

Hi, is there some way to hook Block template made for CPT archive/loop to existing page after its content ? Or maybe is better hook some statis content (made witch blocks) to Archive page of my CPT ? Thanx.

Hi there,

1. if you're trying to display a list of your CPTs on a static page then NO you cannot use a Content Template for that as there is no Loop being generated for it.

2. if your CPTs are built using GP Templates then it will include all the hooks present on that template. See here for examples:

https://docs.generatepress.com/article/hooks-visual-guide/

Then you can hook a block element into them.

ad #2: do You mean Single CPT layout ? No, I create only template for archive/loop and I need display it with some other content. Is it possible without coding ? I used WP Show Post for it for now, but there is poor design :)
My CPT is made with PODS and it only use Title + Featured Image.

This archived topic is closed to new replies.