WordPress.org

Ready to get started?Download WordPress

Forums

How do I change the color of the link in a post once its clicked on? (9 posts)

  1. starvulture
    Member
    Posted 7 years ago #

    Hello, I am using the wordpress default 1.6 theme, and am trying to use the theme editor to change the color of the link in a post once its clicked on. When not clicked on it is a nice blue, and the rollover is fine, but once clicked on it turns a dark red. I want to keep that color blue after it is clicked. It is a fairly simple question but right now it is like finding a needle in a haystack. How do I do this?

    Thanks, Sean

  2. GOBLUE14
    Member
    Posted 7 years ago #

    In your CSS (style.css) file, you'll have lines such as this:

    #content a { color: #000033; }

    Where the "a" shows that it's dealing with links, giving links in the content div the #000033 (or whatever) color.

    You'll also likely see something like:

    #content a:hover { color: #330000; }

    Which is giving the link a color when it's hovered over (or "rollover" color).

    Find where your titles are being given their color (most likely something with ".posttitle" in it) and add:

    #DIVNAME a:visited {color: #XXXXXX; }

    Where the "#DIVNAME" matches the other id's for your posttitle, and the #XXXXXX matches the color of the non-hovered link.

    If you provide a link to your site and/or CSS file, I can probably find what's setting it specifically.

  3. starvulture
    Member
    Posted 7 years ago #

    Alright, sounds like you are on the right track, I find many colors in it, but some of the hex numbers are very short like #333, does this imply that the rest are 0's?

    I think I found the color for the already clicked text, I think it is this one:

    .entry p a:visited {
    color: #b85b5a;
    }

    but I can't seem to find the original color to replace it with.

    Here is a link to my site, thanks for your help.


    http://www.seanfanning.com/blog

    And here is my stylesheet (will be long I know)

    [moderated - too long]

  4. moshu
    Member
    Posted 7 years ago #

    No need to post long code. Helpers usually have to tools to see your stylesheet.
    If you need to post code, use a pastebin service like http://wordpress.pastebin.ca

  5. moshu
    Member
    Posted 7 years ago #

    The "original" color is at
    a {...something}

    P.S. and the #333 means = 333333

  6. GOBLUE14
    Member
    Posted 7 years ago #

    Try #0066cc to get that bright blue. I'm not seeing it anywhere in the CSS, so I'm not sure how it's creating it in the links, but it's showing up in your color information with the Web Developer extension. And #b85b5a is that red you're talking about replacing.

  7. moshu
    Member
    Posted 7 years ago #

    What do you mean you cannot see? Did you look where I suggested to do?

    a, h2 a:hover, h3 a:hover {
    	color: #06c;
    	text-decoration: none;
    	}

    06c = 0066cc

  8. GOBLUE14
    Member
    Posted 7 years ago #

    Ah, it was me (helper, not helpee) that couldn't find that line, as I was looking for the whole #0066cc. And actually I didn't realize that a hex that wasn't all the same digits could be shrunk down like that. Makes sense, though.

    I guess ya learn something every day. ;)

  9. starvulture
    Member
    Posted 7 years ago #

    Great thanks, that worked. (It wasn't me who said I couldn't see it.)

    You were right, the origninal color was #0066cc

    That looks much better. I am sure there are some sites where it is useful to know when you have already clicked on a link, but the red didn't go with my color scheme, and I like links that don't change color if they're visited.

    The places to edit were a bit confusing to me. Here is where the visited link color is:

    .entry p a:visited {
    color: #0066cc;
    }

    I think this is the hover setting

    a:hover {
    color: #147;
    text-decoration: underline;
    }
    Great thanks, that worked. (It wasn't me who said I couldn't see it.)

    You were right, the origninal color was #0066cc

    Thanks, that looks much better. I am sure there are some sites where it is useful to know when you have already clicked on a link, but the red didn't go with my color scheme, and I like links that don't change color if they're visited.

    The places to edit were a bit confusing to me. Here is where the visited link color is:

    .entry p a:visited {
    color: #0066cc;
    }

    I think this is the hover setting

    a:hover {
    color: #147;
    text-decoration: underline;
    }

    What is confusing is I think that this one is the normal setting for link color, even though it says hover because it has the normal color. Is this correct?

    a, h2 a:hover, h3 a:hover {
    color: #06c;
    text-decoration: none;
    }

    Thanks. Even though I am using a template, it is always nice to be able to edit these.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.