我为分享按钮编写了一个条件标签。我希望共享按钮在静态页面中随处可见 - 所以博客的页面元素。我添加了以下条件标记以实现上述效果:
<b:if cond='data:blog.pageType != "static_page"'> The share button coding here </b:if>
我按照本教程的说明 - http://icanbuildablog.com/2015/03/blogger-conditional-tags/ - 非常仔细地确保在应用条件标签时不会出错,但现在共享按钮只显示在项目页面上 - 单个博客帖子。
我已将我插入模板中的完整编码包含在下方:
<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://i1379.photobucket.com/albums/ah140/mynamesiram/Mobile%20Uploads/A036F9A7-1B42-42A6-9DF4-29FE498F231D_zpshfhfvks2.jpg' 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://i1379.photobucket.com/albums/ah140/mynamesiram/Mobile%20Uploads/45AA973D-D8A1-4FAE-A31A-138DA7CB8443_zpsteklwczz.jpg' width='25px'/></a>
<a class='facebook' expr:href='"http://www.facebook.com/sharer.php?u=" + 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://i1379.photobucket.com/albums/ah140/mynamesiram/Mobile%20Uploads/234A9CED-06E8-4D0B-8377-A64D92B082A1_zpsbexuli8g.jpg' 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://i1379.photobucket.com/albums/ah140/mynamesiram/Mobile%20Uploads/F698C5CF-D64E-4C9D-B8DA-AC431C5B343E_zpsvpxnfbuv.jpg' width='25px'/></a>
</div></b:if>
我博客的网址如下:http://www.blankesque.com
答案 0 :(得分:1)
尝试将共享按钮移至.post-footer
部分。 read-more链接会切断.post-body
容器,无法显示它们。