I want to add social share buttons to my posts, but I don’t want to put all that big bulk of code into all my content files. I want to create a function, and then add the function name to my template files, something like this:
function pietergoosen_sosiale_netwerk_deel_knoppies() {
<strong>Deel die pos met ander</strong><p </p>
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="Share on Facebook.">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/facebook.png" alt="Share on Facebook" id="sharethis-last" /></a>
<a href="http://twitter.com/home/?status=<?php the_title(); ?> : <?php the_permalink(); ?>" title="Tweet this!">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/twitter.png" alt="Tweet this!" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="Google+1.">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/google.png" alt="Google+1" id="Google+1" /></a>
<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="StumbleUpon.">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/stumbleupon.png" alt="StumbleUpon" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Digg this!">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/digg.png" alt="Digg This!" /></a>
<a href="http://del.icio.us/post?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Bookmark on Delicious.">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/delicious.png" alt="Boekmerk op Delicious" /></a>
<a href="https://mail.google.com/mail/?view=cm&fs=1&to&su=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="epos.">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/gmail.png" alt="epos" id="epos dit" /></a> }
This isn't working. How should I do it correctly?