• Resolved barnez

    (@pidengmor)


    Hi,
    I am trying to wean myself off social media plugins and have assembled a code and css for share buttons (twitter/facebook, etc.) at the end of each post. The links are working fine (see for example https://www.englishlc.com/antonyms/), but the buttons look a little weak and generic so I want to use social media icons as replacements. The problem is where to place the icon path (src=”/wp-content/uploads/2013/11/twitter.png”) in:

    <div class="social">
    <a href="https://twitter.com/home?status=Reading: <?php the_permalink(); ?>" title="Share on Twitter" alt="Share on Twitter" target="_blank"</a>
    </div>

    I’ve tried using Firebug but the html code seen on each post page is different from that in the single.php file as it renders the post title/permalink.

    Any ideas would be much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    you probably need to use the html code for an image;
    example:

    <div class="social">
    <a href="https://twitter.com/home?status=Reading: <?php the_permalink(); ?>" title="Share on Twitter" alt="Share on Twitter" target="_blank"><omg src="<?php bloginfo('wpurl'); ?>/wp-content/uploads/2013/11/twitter.png" alt="" /></a>
    </div>
    Thread Starter barnez

    (@pidengmor)

    That works perfectly. Many thanks for your advice.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to link to social media image in single.php file’ is closed to new replies.