• I have an admin panel wich has the colorpicker and I integrated into my theme everything work fine but now I want to do that multipurpose.

    I changed the type to color and now in my theme settings page color box appears its working my question is this > for example I want to change the a:hover links how can I do that where to use the code <?php if (get_option(‘xx_hovercolor’) ”) { ?> in style.css?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter giuseppe23

    (@giuseppe23)

    anyway I found the solution how to change the body background color from adminpanel with colorpicker

    I added something like this

    <?php
    $bodybg = get_option('test_bbg');
         echo '<body style="background-color:'.$bodybg.'">';
    ?>

    But I’m looking to undesratnd how to change the hover links color of my site with colorpicker.anyone that has experience?
    Can someone explain please?

    changing the body background were easy but links? because I cant add php into css but how can I do?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I use Chrome’s developer tools to find that stuff out.
    Here’s a useful tutorial for Chrome’s dev tools to help find CSS: https://dailypost.wordpress.com/2013/07/25/css-selectors/

    Additional Chrome dev info:

    * https://developers.google.com/chrome-developer-tools/
    * https://developers.google.com/chrome-developer-tools/docs/dom-and-styles

    Thread Starter giuseppe23

    (@giuseppe23)

    Thankyou for your respopnse but I’m linux user and I use bluefish with gcolor but I’m not asking a tool how to work.
    I created a wordpress theme and included an admin options page wich has colorpicker integrated inside.I know using options a little bit and I got the colorpicker into my theme options page..

    The code wich I gave above worked fine to change the body background color from my theme settings page.

    My Questions is this:
    How can I give the possibility to change the a:hover links color from settings page.

    adding this tag into php ‘<body style=”background-color:’.$bodybg.'”>’;
    was easy But would be nice to have possibility to change the links color,menu background etc.

    Thread Starter giuseppe23

    (@giuseppe23)

    Maybe my question is not so easy because my bad english for you.
    So I’m fixing my question to:

    How to change links color with php in wordpress?
    or
    How to use php in css

    an Example wich I did before colsing tag </head> but didnt work:

    <?php
    $linkcolor = get_option('mytheme_linkclr');
    ?>
    <style type="text/css">
    .pagination a:hover{
    	background: <?php echo $linkcolor; ?>;
    }
    .pagination .current{
    	background: <?php echo $linkcolor; ?>;
    }
    </style>

    I change the color from colorpicker in my theme settings but it has the default color yet.

    Any help pleae.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use colorpicker?’ is closed to new replies.