img { filter: gray; /* IE6-9 */ filter: grayscale(1); /* Firefox 35+ */ -webkit-filter: grayscale(1); /* Google Chrome, Safari 6+ & Opera 15+ */ } /* Disable grayscale on hover */ img:hover { filter: none; -webkit-filter: grayscale(0); } 

This code uses css filters. When added to the style.css file, Wordpress'a turns all pictures (which are described by a tag) into gray, and when you hover the mouse, it shows colors. But the problem is that it acts equally on all the pictures on the page. Is it possible to make it work only in one sidebar? Thank you for attention.

    1 answer 1

    It is necessary to more precisely indicate the link to this tag, for example:

     .sidebar img:hover { } 
    • I tried. Pictures in the sidebar'e not impressed. The file where the sidebar is encoded is called sidebar.php, and the code in it is <div id = "sidebar ...> ... </ div> - Emil
    • Ultimately helped, thanks! - Emil