I have an image displayed in the following manner:
<img src="<?php bloginfo('template_directory')?>/images/logo/logo.png"> Now, however, I want to create a shortcode that has an attribute and uses that same image inside it. So I tried the following:
add_shortcode('scrollTop', function(){ echo "<a href='#content' class='content'>"; echo "<img src='bloginfo('"template_directory"')/images/logo/logo.png'">; echo "skipping content"; echo "</a>"; }); Its a syntax error I assume, but am struggling to find a way around.
How can I add the image inside the shortcode?