Hi fr0d0!
Here’s some code snippet. You should paste it into the end of Your active WordPress theme’s functions.php file:
function dg_rollover_js() { ?>
<script type="text/javascript">
jQuery(document).ready( function(){
jQuery( '.document-icon img' ).wrap( '<span></span>' );
} );
</script>
<?php }
add_action( 'wp_print_footer_scripts', 'dg_rollover_js' );
function dg_rollover_css() {
echo <<<EOT
<style>
.document-icon > a > span {
position: relative;
display: inline-block;
}
.document-icon > a:hover > span:before {
content: '\\f504';
font: normal 30px/1 'dashicons';
top: 50%;
left: 50%;
display: block;
position: absolute;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-webkit-font-smoothing: antialiased;
}
.document-icon > a:hover img {
opacity: 0.3;
filter: alpha(opacity=30);
}
</style>
EOT;
}
add_action( 'wp_head', 'dg_rollover_css', 100 );
Please let us know if there is any resemblance with Your concept.
Don’t hesitate to ask if you run into any further questions!
PS: If You’ve found our answers useful, please rate our efforts. Thanks!