Site logo

Archived topic

Change links color in post/page

16 replies · Started by Velin on February 13, 2019

Viewing posts 1–15 of 17

Hi there,

I have a quick question about the links in my posts and pages. I know I am able to change the link color from Customize -> Colors -> Content. However, this also changes the links color on my home page (as I have set it to show my latest posts). I need to be able to define a custom color only for the text links which I'm including in my posts and pages, without messing with the rest of the links.

Is there any way to achieve that?

Thanks,
Velin

Hi there,

you can target them specifically with this CSS - just change the colors accordingly:

.single-post .entry-content p a, .single-post .entry-content li a {
    color: red;
}
.single-post .entry-content p a:hover, .single-post .entry-content li a:hover {
    color: green;
}

Hi David,

Thanks, works like charm :)

glad to be of help

Hi, sorry to reopen this, but I've noticed something. After I applied the custom CSS, the links in my social icons are also in the same color as my main links.

Mind if you take a look and let me know how to fix that? I believe you have a link to the website, click on the latest post and scroll down to the bottom of the page to see it.

Thanks,

Velin

I edited the code above so it will only effect the links within a paragraph.

Thanks :)

You're welcome

Hi David,

Sorry for reopening this thread. Any chance to update the code to affect links in list items too?

Thanks,
Velin

No problems. edited the code above to include lists :)

As always thank you for the quick reaction :)

Hi,
When I in admin mode, I can see the link color in blue but when seeing the publish view or the actual published view the link colors are in black color only. Please help

Hi there,

can you raise a new topic where you can share a link to your site so we can see what the issue is.

Hello David,
thankyou for the above code that helped my to solve one problem!
However, now the headlines of posts that I am showing via the WP Show Posts plugin inside a posting (e.g. referrals to other posts) are also in the same colour. These should remain in the colour which I have assigned to them in Customiser/Colors/Content.
Help would be very much appreciated!
Thanks, Paul

Hi Paul,

can you raise a new topic where you can use the Private Information field to share a link to the page where i can see the change you require

This archived topic is closed to new replies.