“相关帖子”博客上的图片,未出现

时间:2020-05-04 19:53:40

标签: templates blogger

全部 我正在为Blogspot定制主题。 本文结尾处有“相关帖子”功能。我发现了一个问题,其中没有出现缩略图图像(但默认图像显示为“无图像”)。但是会显示帖子标题。

这是我的代码:

<b:if cond='data:post.thumbnailUrl'>
    <a expr:href='data:post.url'><img expr:alt='data:post.title' expr:src='resizeImage(data:post.thumbnailUrl, 420, &quot;300:200&quot;)' expr:title='data:post.title'/>
    </a> 
  <b:else/>
    <b:if cond='data:post.firstImageUrl'>
    <a expr:href='data:post.url'><img expr:alt='data:post.title' expr:src='data:post.firstImageUrl' expr:title='data:post.title'/>
    </a>
  <b:else/>
    <a expr:href='data:post.url'><img expr:alt='data:post.title' expr:title='data:post.title' src='//3.bp.blogspot.com/-ltyYh4ysBHI/U04MKlHc6pI/AAAAAAAADQo/PFxXaGZu9PQ/w420-h280-c/no-image.png'/>
    </a>
  </b:if>
<script>
var labelArray = [<b:if cond='data:post.labels'><b:loop values='data:post.labels' var='label'>&quot;<data:label.name/>&quot;<b:if cond='data:label.isLast != &quot;true&quot;'>, </b:if></b:loop></b:if>];
var relatedPostConfig = {
    homePage: &quot;<data:blog.homepageUrl/>&quot;,
    widgetTitle: &quot;&lt;div class=&#39;label-line-c&#39;&gt;&lt;h4&gt;Related Posts&lt;/h4&gt;&lt;/div&gt;&quot;,
    numPosts: 8,
    titleLength: &quot;auto&quot;,
    thumbnailWidth: 250,
    thumbnailHeight: 170,
    noImage: &quot;//3.bp.blogspot.com/-ltyYh4ysBHI/U04MKlHc6pI/AAAAAAAADQo/PFxXaGZu9PQ/w255-h170-c/no-image.png&quot;,
    containerId: &quot;related-post-<data:post.id/>&quot;,
    newTabLink: false,
    moreText: &quot;Read More&quot;,
    widgetStyle: 3,
    callBack: function() {}
};
</script>

Picture of Thumbnail image does not appear

请帮助,谢谢!

0 个答案:

没有答案