Create an active on image if url is

I’m busy with an WordPress website. On this website there are some images with an hover.
When the hover is active it will change from black/white to color image.

Now as you can see on the website, top right you see the images.
When you hover the color change. But when you’re on the page http://www.freshymedia.nl/inge/site/ the first image needs to be colored.

Read More

And for example when you’re on this page: http://www.freshymedia.nl/inge/site/contact/
The last image needs to be colored and the rest only needs to hover when you want to hover it.

Anyone has a solution for me?
The website has been build in WordPress.

Related posts

Leave a Reply

1 comment

  1. The way I do things to test for current pages is by using the functions.php for this code:

        $host = $_SERVER['REQUEST_URI']; //finding out the url
    
        $contactimg = 'http://LINK TO YOUR B&W IMAGE.jpg'; //B&W image link - the normal image
    
        if ($host == '/contact/') //if url is contact
        {
         $contactimg = 'http://LINK TO YOUR COLOUR IMAGE.jpg'; //Current page image
        }
    

    Then in the code where your images are you’d have:

        <a href="/contact"><img src="<?php echo $contactimg ;?>" /></a>
    

    Hopefully that makes sense…

    Also to check what url to put in instead of “contact” you can echo host on a page

        <?php echo $host;?>
    

    That’ll display the url for the page that you are currently on.