问题
I'm trying to change the text of the read more button in Blogger. I've been searching everywhere in the code for or but it doesn't exist.
But here's what I found:
<div class='mobile-index-arrow'>&rsaquo;</div>
<div class='mobile-index-contents'>
<b:if cond='data:post.thumbnailUrl'>
<div class='mobile-index-thumbnail'>
<div class='Image'>
<img expr:src='data:post.thumbnailUrl'/>
</div>
</div>
</b:if>
<div class='post-body'>
<b:if cond='data:post.snippet'><data:post.snippet/></b:if>
</div>
</div>
So I guess I have to add something to this "snippet part", but I don't really know what to add... Please, does anyone know how to change the read more text? Thanks!
回答1:
Method 1:
You can change the text in read more button from Blogger Layout.
Go to Dashboard > Layout > Main > Edit
Method 2:
Go to Dashboard > Template > Edit HTML
In post section find this code (below post-body part)
<b:if cond='data:post.hasJumpLink'>
<div class='jump-link'>
<a expr:href='data:post.url + "#more"' expr:title='data:post.title'><data:post.jumpText/></a>
</div>
</b:if>
Replace <data:post.jumpText/>
with whatever text you want to display in place of Read More
eg:
<b:if cond='data:post.hasJumpLink'>
<div class='jump-link'>
<a expr:href='data:post.url + "#more"' expr:title='data:post.title'>View Post</a>
</div>
</b:if>
Method 3:
Add the this script at the end of <b:includable id='post' var='post'>
inside main section
.
<b:if cond='data:blog.pageType not in {"static_page","item"}'>
<script type='text/javascript'>
$("#summary<data:post.id/> .post-entry a.more-link").html("<data:post.jumpText/> <i class='fa fa-long-arrow-right'></i>");
</script>
</b:if>
With this you can change Read More text from dashboard, as described in Method 1.
回答2:
checked Method 1: which is the best solution Go to Dashboard > Layout > Main > Edit use Method 3 incase you have edited from HTML
来源:https://stackoverflow.com/questions/32724188/problems-with-changing-read-more-text-when-using-snippet-summaries-in-blogger