Site logo

Archived topic

Comment Post Button CSS based on Post Category

8 replies · Started by Srijith on September 24, 2021

Viewing posts 1–9 of 9

Hello,

Would it be possible to set the background color of the post comment button based on the category of the post?

Regards,
Srijith

Hi there,

not sure how easy that would be to do.
Can you share a link to a post where i can see the comments form and the post has a specific category.

Hello,

This is the URL of the concerned post.

regards,
Srijith

Hi Srijith,

Give this CSS a try:

.category-finance + .comments-area input[type=submit] {
    background-color: red;
    color: white;
}

You can replace the finance with other category names.

Let me know if this helps :)

Hi Ying,

That worked. Thank you for your help.:)

Regards,
Srijith

Hello,

One more question. How could I bring this category factor also for the title background color? This is the CSS I currently have.

h1.entry-title {
background-image: linear-gradient(
0deg,#DCE3D4 35%,transparent 35%);
display: inline;
}

Regards,
Srijith

You can try this:

.category-finance .entry-title {
    background-image: linear-gradient(0deg,#DCE3D4 35%,transparent 35%);
    display: inline;
}

Perfect. Thanks a lot.:)

You are welcome :)

This archived topic is closed to new replies.