- This topic has 7 replies, 3 voices, and was last updated 2 years, 3 months ago by
David.
-
AuthorPosts
-
February 24, 2023 at 10:13 am #2545817
Marc
I’m a bit lost. I’m trying to make completely custom category pages. Other posts on this topic refer more to content template blocks, but that’s not really what I’m after. Not only do I want the posts loop, but I need to add custom content to the page. Is there a way to do with with the elements features of GP Pro? I also have GP Blocks.
As a workaround, I’m currently using static pages with query loops to get the posts which works fine. But the category links in the post meta obviously still points to the native WP cat page. I can write a function to point it to my custom page, but I’d rather not do that. I’d like to achieve this functionality with GP elements if possible.
Thank you!
February 25, 2023 at 3:56 am #2546358David
StaffCustomer SupportHi there,
when it comes to adding custom content to an archive page, there are two main methods that could be used, and this comes down to how and where that custom content is saved.
Option 1 – Static Content.
This is akin to what you’re doing today, but instead of creating a Page for each Category Term, you would create a separate Block Element – Loop Template for each term.1. Appearance > Elements -> Add New –> Block Element.
2. Select the Element Type -> Loop Template
3. Set the Display Rules -> Location –> Category Archive —> The Specific Term.
4. In The editor you can now add your content.
4.1 The content should include a GB Query Loop Block that you can set toInherit Query from Template
or set the Params manually to match your term.
5. Publish that.
6. Repeat the above for every term.Option 2 – Dynamic
The Custom Content would need to be stored in term meta Custom Fields which is then managed from the Category term edit page. That would need custom development or a plugin like ACF or Metabox.
Then you could do the above with just 1 loop element, that uses GenerateBlocks Dynamic data, or in some cases a shortcode to add custom content dynamically to the element.If you are ok maintaining static pages today, then you may want to use option 1, and not bother with the custom field route of option 2.
Let me know
February 25, 2023 at 9:14 am #2546747Marc
Thanks, David. From a practical standpoint, what’s the difference between using a custom page with query loops vs Block Element – Loop Template? Both require a manual query loop setup, right?
February 26, 2023 at 6:13 am #2547326David
StaffCustomer Supportcustom page with query loops vs Block Element – Loop Template
For option 1 – not a lot of difference.
Both require you to create a “post” be that a page or an element for each individual term.
The Loop Element has benefits as it “replaces” the themes archive.php template so:
1. it will be automatically linked to by post meta terms without redirects.
2. it doesn’trequire
the request filter function to workFebruary 26, 2023 at 12:23 pm #2547754Marc
Got it, thanks.
February 27, 2023 at 2:37 am #2548302David
StaffCustomer SupportYou’re welcome
April 7, 2023 at 5:14 am #2600777Kyle
YES. This finally solved what I was trying to do.
David, As I’m building out my site I have come to look for your face and try out your answers first. I’m guessing you’re helping more people than you even think.
Several of your custom shortcodes for other people have come in handy for me as well.
Thanks for the quality answers.
April 7, 2023 at 7:50 am #2600934David
StaffCustomer SupportHi Kyle,
thank you for the kind words it is much appreciated, and i am glad to hear this 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.