[Resolved] Exclude first post content template for specific category

Home Forums Support [Resolved] Exclude first post content template for specific category

Home Forums Support Exclude first post content template for specific category

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #2010640
    Tan

    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.

    #2010885
    David
    Staff
    Customer Support

    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.

    #2010921
    Tan

    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.

    #2011190
    David
    Staff
    Customer Support

    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.

    #2011268
    Tan

    Thank you, David. I got it 😀

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

    #2011276
    David
    Staff
    Customer Support

    WP doesn’t support Sticky Posts for Categories by default.
    To the best of my knowledge this plugin is the only way to do it without custom development:

    https://wordpress.org/plugins/category-sticky-post/

    #2017562
    Tan

    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?

    #2017771
    David
    Staff
    Customer Support

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

    #2017976
    Tan
    #2018337
    Ying
    Staff
    Customer Support

    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?

    #2018722
    Tan

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

    #2018729
    Ying
    Staff
    Customer Support

    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?

    #2018738
    Tan

    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.

    #2018830
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

    #2018981
    Tan

    Ok. Thank you for your help 😀

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.