Can anyone help?

I'm trying to show a default placeholder image on my posts when the user hasn't uploaded an image.

I have the below code BUT i need to rewrite it so that the link isn't applied to the placeholder image - only the uploaded image.

Unfortunately my PHP isn't great at all so would appreciate some help.. 

&lt;div class="imageContainer"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;
           &lt;?php
    // Must be inside a loop.

    if ( has_post_thumbnail() ) {
        the_post_thumbnail('size-2');
    }
    else {
        echo '&lt;img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/shared/placeholder.jpg" /&gt;';
    }
    ?&gt;
            &lt;/a&gt;&lt;/div&gt;



Question: How can I build a switching circuit that scales several 12v signals down to <5v?
Answer: Why exactly are you concerned about 12V on those wires?  

Its perfectly fine and doesn't represent any more or less danger than 5V would, or even GND honestly.