I coded a conditional tag for my share buttons. I wanted the share buttons to appear everywhere apart from in static pages - so the pages element of blogger. I added the following conditional tag to achieve the above stated affect:
<b:if cond='data:blog.pageType != "static_page"'> The share button coding here </b:if>
I followed the instructions to this tutorial - http://ift.tt/1XQvT9f - very carefully and made absolute sure to make no mistake when applying the conditional tag however now the share buttons only appear on item pages - single blog posts.
I have included the full coding I inserted in my template, below:
<b:if cond='data:blog.pageType != "static_page"'>
<div class='sharebtns'>
<a class='twitter' expr:href='"https://twitter.com/share?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank' title='Tweet This'><img alt='Tweet This' border='0' height='25px' src='http://ift.tt/1OF7LpN' width='25px'/></a>
<a class='email' expr:href='"mailto:?subject=" + data:post.title + "&body=" + data:post.url' rel='nofollow' target='_blank' title='Share Via Email'><img alt='Share Via Email' border='0' height='25px' src='http://ift.tt/1XQvR1c' width='25px'/></a>
<a class='facebook' expr:href='"http://ift.tt/KvaSOc; + data:post.url + "&t=" + data:post.title' rel='nofollow' target='_blank' title='Share This On Facebook'><img alt='Facebook Share' border='0' height='25px' src='http://ift.tt/1XQvR1g' width='25px'/></a>
<a class='comment-form' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick.com' title='comment-form'><img alt='comment-form' border='0' height='25px' src='http://ift.tt/1OF7LG3' width='25px'/></a>
</div></b:if>
The URL for my blog is as follows: http://ift.tt/1LCaMqV
Aucun commentaire:
Enregistrer un commentaire