Support » Themes and Templates » Change link colour

  • Resolved tooly228

    (@tooly228)


    If you visit my site cpcheatscp.com, you’ll see that my under my css for the link, the code is as follows:

    a:link, a:active {
    border:medium none;
    color:#3664B2;
    text-decoration:none;
    }

    However, I want my categories and tags which can be found just below the post title to be a different colour meanwhile they are under the code above. How do I change the colour of the categories links but not change the colour of the other links in the post content?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Change #3664B2 to color you want that does not change links in post. how ever it changes links in side bar.

    Thread Starter tooly228

    (@tooly228)

    No, it does change the link colour in the post and the sidebar. I just want the categories links to be a different colour.

    These are the only “link” styles within your CSS.

    a:link,a:active{text-decoration:none;color:#3664B2;border:none;}
    a:visited{text-decoration:none;color:#069;border:none;}
    a:hover{text-decoration:underline;color:#69c;border:none;}

    You would need to define a new class within your CSS and assign it specifically to the “entry2” class and then change the color on it.

    Example:

    #entry2 a:link,a:active{text-decoration:none;color:#3664B2;border:none;}
    entry2 a:visited{text-decoration:none;color:#069;border:none;}
    entry2 a:hover{text-decoration:underline;color:#69c;border:none;}

    Sorry, should have been this……..

    #entry2 a:link,a:active{text-decoration:none;color:#3664B2;border:none;}
    #entry2 a:visited{text-decoration:none;color:#069;border:none;}
    #entry2 a:hover{text-decoration:underline;color:#69c;border:none;}
    Thread Starter tooly228

    (@tooly228)

    OK I’ve added them to my CSS stylesheet but how do I assign the categories to that specific class when it’s in PHP. This is what I have in index.php:

    <div class=”entry2″>Categories: <?php the_category(‘, ‘) ?>…

    See the categories is under that div class but how do I make the links in the categories under the #entry2 a: class?

    Thanks.

    Sorry, try .entry2 not #entry2. This would then match your entry2 class that you already have and tie in the A link attributes.

    Something is very screwy with your code.

    </div class="entry"><div class="entry2">Categories:

    There should never be a class=”” in a closing DIV tag.

    What template are the category tags links coming from? You will need to go to that template and add class=”entry2″ to the a href tag.

    Thread Starter tooly228

    (@tooly228)

    This worked!

    try .entry2 not #entry2

    I thank you so much for your help on this. And the reason why I put class=”” in the closing div tag because I wanted that class to end and not the other class that it is under.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Change link colour’ is closed to new replies.