• Resolved Michael

    (@tony-alibaba)


    Hey guys, I’m trying to change the color of the links sitewide
    I’ve searched snippets and google and all I found was

    a:hover,
    a:focus {
    color: #005580;
    text-decoration: underline;
    }

    ideally just the author links is all i want to change

    but this doesn’t seem to be working, any suggestions would be great, thank you guys.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hey Michael,

    If you want to change ALL of the links in your site, all you have to add to your code is this:

    a {
      color: #008000 !important;
    }

    You can change the color code to whatever you like

    Important: Just copy and paste this code into the bottom of your Custom CSS or Child Theme style.css so that you won’t lose your changes once you update your theme in the future. A Child Theme is the safest and best way to go when doing all kinds of modifications.

    Hope this helps!

    -Trey

    Thread Starter Michael

    (@tony-alibaba)

    it is the by-author class,
    seems I have a bigger issue going on.

    Can I check a couple of things:

    How are you applying that extra css onto your website?

    The css you posted would only change the colour of links when you hower or tab onto them, is that what you want?

    Thread Starter Michael

    (@tony-alibaba)

    Oh, thanks for letting me know that! I appreciate it bud, I was applying the css via the customizr panel, I was wanting to change author links in posts but I’m using a plugin called User Submitted Posts with a snippet template for showing author links that link back to their website and I’ve added this into the functions php and author links in posts have lost the ability to class through css, I’m most likely going to have to change the color through the plugin.

    Ah, sounds like quite a complicated set up, do you mind if I ask if you have a link to this site?

    Thread Starter Michael

    (@tony-alibaba)

    Absolutely, thank you for asking it is https://poetsayings.com with now 32 plugins, you can find a list of all the plugins, I posted them two days ago to the forum. I appreciate the interest!
    I’m currently setting up a guest submission front end so users can post poems to the website.

    Are these the links you’re targeting?

    https://cloudup.com/cH4uKB7jtEu

    If so, then unless the user submitted posts plugin is doing something odd with the css I think this would work:

    .author a {
        color: #005580;
    }

    Got to head off now, but I’ll check in tomorrow

    Thread Starter Michael

    (@tony-alibaba)

    Hey buddy, thank you for sharing that with me! It didn’t seem to have any affect, this was the function I added.

    add_filter('tc_author_meta', 'my_author_meta');
    function my_author_meta( $author ){
        if ( ! function_exists('usp_author_link') )
            return $author;
        ob_start();
    ?>
        <span class="author vcard"><?php usp_author_link(); ?></span>
    <?php
        $author = ob_get_contents();
        if ($author) ob_end_clean();
        return $author;
    }

    You can see how it would easily override the css because the the usp_author_link is the call function. and not the typical codex author function.

    Anyhow, I really appreciate the effort as well as your valuable and all my friend!

    Michael is this resolved then?

    With css the precise php code isn’t as important as the HTML output. From what I saw of your test post yesterday usp_author_link() just produces a link wrapped in a span with a custom class, so normally the css I posted would work. If you’re happy to repost you’re test and add the css I posted then I can see if something’s overriding it, otherwise I don’t know what’s going wrong, sorry.

    Thread Starter Michael

    (@tony-alibaba)

    This is why I love customizr, you all are awesome, I’m going to get back on this, I think I can figure it out and i know what the issue is, I want to thank you both D4 and Chris, you guys are very cool, have a nice night. Hope you are feeling better D!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Change color of author links sitewide’ is closed to new replies.