[Support request] How to change the bg-colours for buttons on archive-pages dynamically?

Home Forums Support [Support request] How to change the bg-colours for buttons on archive-pages dynamically?

Home Forums Support How to change the bg-colours for buttons on archive-pages dynamically?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2395724
    Sascha

    Hello,

    on this archive-page, I’d like the “Read more” buttons (here: “Weiterlesen” buttons) to have different bg-colours:

    Button of latest post: green-bg
    Button of latest but 1 post: yellow-bg
    Button of latest but 2 post: black-bg
    and restarting with green again.

    Is this something I can achieve with GP/GP-Elements?

    Thank you in advance and kind regards,
    Sascha

    #2395885
    Ying
    Staff
    Customer Support

    Try this:

    :is(.blog,.archive) article.post:nth-of-type(3n) .read-more-container a {
        background: black;
    }
    
    :is(.blog,.archive) article.post:nth-of-type(3n-1) .read-more-container a {
        background: yellow;
    }
    
    :is(.blog,.archive) article.post:nth-of-type(3n-2) .read-more-container a {
        background: green;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.