WordPress.org

Ready to get started?Download WordPress

Forums

Change Link Color (11 posts)

  1. IlanK
    Member
    Posted 2 years ago #

    Hi,

    I'm trying to change the color of my links in the posts at http://www.ironwhisk.com. I am using the Ari theme.

    I don't want to change the color of the titles or anything like that. The code that I can use to change the color of all the links (not just the ones in the posts) is this:

    a, #content h2 a:hover{
    	text-decoration:none;
    }

    But I just want to change the color of the links inside the text. What code can I use?

  2. michael.mariart
    Member
    Posted 2 years ago #

    Standard CSS for link colour (only) would be

    a {
        color: #FF0000;
    }

    Of course, the value of #FF0000 would be whatever colour you want to change it to.

  3. IlanK
    Member
    Posted 2 years ago #

    I don't want to change all the links, I just want to change the links in the post. I don't want to change the post permalinks, the links in the sidebar, etc. Just the ones in the post.

  4. michael.mariart
    Member
    Posted 2 years ago #

    Ok, then put the main elements class in front of it. Easy done.

    .hrecipe a {

    That changes every <a> element inside any element that has a class of hrecipe.

  5. radhika
    Member
    Posted 2 years ago #

    @IlanK

    you have to go in your wp-admin:
    wp-admin> Appearance> theme options >edit the color in Second Link Color.

  6. IlanK
    Member
    Posted 2 years ago #

    The second link colour changes the colour of the sidebar widgets. I'm going to try what you said Michael - gimmie a minute.

  7. IlanK
    Member
    Posted 2 years ago #

    That works great. Thanks!

  8. IlanK
    Member
    Posted 2 years ago #

    Actually - not all of my posts have the hrecipe div around them. How can I make this work whether or not it's there?

  9. michael.mariart
    Member
    Posted 2 years ago #

    Figure out what you have as a common container element, and use that.

  10. IlanK
    Member
    Posted 2 years ago #

    <div id="forlinks">
    	<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and 
    
    search. ?>
    			<?php the_excerpt(); ?>
    			<p class="meta"><span><a href="<?php the_permalink(); ?>">
    	<?php else : ?>
    
    			</div><?php the_content( __('Read more >>', 'ari' ) ); ?>

    Ok see that div? If I place it there, then the links don't underline at all in the loop. If I put the closer after the line it is at now, it underlines the read more. I don't want it to underline the read more. Where do I put the div?

  11. radhika
    Member
    Posted 2 years ago #

    ok, you put this code in your style.css of your theme.

    .meta a:hover{
    color: #565656 !important; <-- here change color
    }

Topic Closed

This topic has been closed to new replies.

About this Topic