• Hey, I’m having a problem where I want the hyperlinks in my blog post to show as blue, but if I change the:
    .post_content a { color: black; }

    Into

    .post_content a { color: blue; }

    My post headlines on the main page also turn from black to blue. I want them to remain black.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You should try to be more specific by targeting the headlines within your posts if you want them to remain black.

    You can try adding another wrapper to your the_content() and use that new wrapper selector to target the a.

    For example:

    PHP:

    <div class="wp-the-content">
       <?php the_content(); ?>
    </div>

    CSS:

    .wp-the-content a {
      // Your CSS here
    }

    im most cases (depends on your currently used theme), the content will be within an element which has CSS classes added via ‘post_class()‘ which mostly includes .hentry;
    try:

    .post_content .hentry a { color: blue; }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing hyperlink color (a: {}) without changing headline link color’ is closed to new replies.