【问题标题】:Show Advertisement (AdSense) only for specific labels in blogspot仅针对 blogspot 中的特定标签显示广告 (AdSense)
【发布时间】:2020-05-13 02:11:26
【问题描述】:

我想在特定标签中显示广告,如下所示:

但这不起作用。它什么也没告诉我。我该如何解决这个问题?我想为 Gartenblog、Foodblog、Reiseblog、Fotoblog 和 Blogging 标签显示 Google AdSense,如果没有这些标签,它应该显示另一个广告。我该怎么做?

<b:if cond='data:post.labels none (label => label.name in ["Gartenblog","Foodblog","Familienblog","Reiseblog","Fotoblog","Blogging"])'>
<b:if cond='data:post.labels any (label => label.name == ["Gartenblog","Foodblog","Familienblog","Reiseblog","Fotoblog","Blogging"])'>

如果我只使用一个标签,它可以正常工作,而不是多个。

【问题讨论】:

    标签: html blogger adsense


    【解决方案1】:

    检查长度:

    <b:if cond='(data:post.labels where (label => label.name in ["Gartenblog","Foodblog","Familienblog","Reiseblog","Fotoblog","Blogging"])).length gt 0'>
      <!-- Ad One -->
    <b:else/>
      <!-- Ad Two-->
    </b:if>
    

    【讨论】:

      猜你喜欢
      • 2021-12-26
      • 1970-01-01
      • 2014-10-14
      • 2016-07-01
      • 2013-08-11
      • 1970-01-01
      • 2018-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多