Problems with changing read more text when using snippet summaries in Blogger

孤街醉人 提交于 2019-12-06 14:43:50

问题


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'>&amp;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 + &quot;#more&quot;' 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 + &quot;#more&quot;' 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 {&quot;static_page&quot;,&quot;item&quot;}'>
        <script type='text/javascript'>
             $(&quot;#summary<data:post.id/> .post-entry a.more-link&quot;).html(&quot;<data:post.jumpText/> &lt;i class=&#39;fa fa-long-arrow-right&#39;&gt;&lt;/i&gt;&quot;);
        </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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!