Site logo

Archived topic

Exclude first post content template for specific category

15 replies · Started by Tan on November 19, 2021

Viewing posts 1–15 of 16

I have 6 categories on my blog. I am using a global content template with elements for 5 categories (apply to all post) and the other template for the last one (apply to one category, parent element is the previous template).
How could I use first post template for each type of content template?
Thank you.

Hi there,

if i understand correctly you want:

1. A template for the First (latest) Post - this will apply to blog and all category archives.
2. A template for all other posts in first 5 categories.
3. A separate template for the last category.

If so ... not 100% sure on this but you cant try:

1. Create the template that will be used across your first 5 categories. This should be set to display on ALL Category Archives. This will be used as the parent.
2. Create a second template for your other Category, set it to Apply To: Posts with Term. And set select #1 element for its parent.
3. Repeat #2 for your First Post template and use the Apply to: First Post. Again set its parent to #1 element.

Hi David,

Thank you for your reply. What I want:

1. 2 Templates for the First (latest) Post – One will apply to blog and the first 5 category archives, another one will apply to the last category.
2. A template for all other posts in first 5 categories.
3. A separate template for the last category.

It would require 4 templates:

Template #1 for all other posts on blog and 5 cateogories. Set its Display Rules to blog and the 5 categories
Template #2 for first Post on Blog and 5 categories. Set Apply to: First Post. Set its Parent to Template #1.

Template #3 for all other posts on Category 6. Set its Display Rules to the 6th category.
Template #4 for First post on Category 6. Set Apply to: First Post. Set its Parent to Template #3.

Thank you, David. I got it :D

But how can I make a sticky post (in category 6) display at the first post for category 6 archive?

Thank you, David. I use the plugin you recommend, and it worked for 5 first categories. But the last category doesn't work. I have no idea why.

It doesn't show the sticky post but the latest post.

Can you take a look?

Not sure on this one - can you share a link to a category where the Sticky post is working?

There're 2 posts in the category set to be stikcy: Kèo Ethereum & Kèo Bitcoin.

Can you try uncheck the sticky option for one of them?

Arg... Sorry, it's my mistake.
I turn off Kèo Bitcoin post, and it still doesn't work.

No worries :)

Looks GP's content template is working fine for the first post on that category archive page.

It's the sticky function not working, so we have no control over it, can you try to reach out to the plugin support instead?

I tried, but It seems like this plugin isn't updated for 3 years :( and no support now. I checked on WordPress support forum.
Can you help me solve this, please?
Thank you so much.

Hi Tan,

While I can think of ways to make sticky posts of specific categories to the top of the listing, it won't work with Block Element - Content templates because it will require third-party post list plugins or creating an actual .php file for custom loop.

As for the plugin, I'm afraid we can't do anything with it as it isn't something developed by GP's dev team and it's not exactly a widely used plugin for use to have at least a certain level of familiarity to play around with it's coding, unfortunately.

Ok. Thank you for your help :D

This archived topic is closed to new replies.