WordPress post image change on hover (ACF?)
<p>On a WordPress page, I'm having the post image as a background-image in the header. Here's how it is solved:</p>

<pre><code>&lt;?php if (has_post_thumbnail( $post-&gt;ID ) ): ?&gt;
        &lt;?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post-&gt;ID ), 'full' ); ?&gt;
        &lt;?php else : ?&gt;
        &lt;?php endif; ?&gt;         

        &lt;header class="header" role="banner" itemscope itemtype="http://schema.org/WPHeader" style="background-image: url('&lt;?php echo $image[0]; ?&gt;')"&gt;...&lt;/div&gt;
</code></pre>

<p>What I want now is add a second image to the post (Advanced Custom Fields??) which should be displayed on hover. How can I achieve this?</p>

<p><strong>EDIT</strong> </p>

<p>Since not every header image has a second image for hover, I have created 2 custom fields called "normal" and "hover". If the post has a post image, it's a "static" header, if there is no post image, I'm getting "normal" and "hover". I creted a condition to distinguish those 2 types:</p>

<pre><code>&lt;?php if (has_post_thumbnail( $post-&gt;ID ) ): ?&gt;
    &lt;?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post-&gt;ID ), 'full' ); ?&gt;
    &lt;header class="header" role="banner" itemscope itemtype="http://schema.org/WPHeader" style="background-image: url('&lt;?php echo $image[0]; ?&gt;')"&gt; 
&lt;?php else : ?&gt;
    &lt;header class="header" role="banner" itemscope itemtype="http://schema.org/WPHeader" style="background-image: url('&lt;?php the_field('normal'); ?&gt;');"&gt;   
&lt;?php endif; ?&gt; 
</code></pre>

<p>What I need now is to get my second image, "hover" as a hover...</p>