【问题标题】:Blogger: Removing Post Text From Blog GadgetBlogger:从博客小工具中删除帖子文本
【发布时间】:2017-02-18 17:08:11
【问题描述】:

我遇到了另一个问题,我可以使用一些帮助来解决,同样是关于 Blogger 中的博客小部件/小工具。

作为标准,Blogger 博客小工具会在登录页面上显示您的最新帖子,我想要做的是完全隐藏帖子,这样当您打开标题链接时,它会将您带到该单独的帖子并显示博客正文。

这可能会在其他地方得到回答,无论是在这里还是在线,但我找不到任何真正回答这个问题的东西;无论是我表达我不知道的问题的方式,如果我重复其他地方提出的问题,我很抱歉。

无论如何,这是 Blogger 用来调用您的博文的编码:

<div class='blog-posts hfeed'>

  <b:include data='top' name='status-message'/>

  <b:loop values='data:posts' var='post'>
    <b:if cond='data:post.isDateStart and not data:post.isFirstPost'>
      &lt;/div&gt;&lt;/div&gt;
    </b:if>
    <b:if cond='data:post.isDateStart'>
      &lt;div class=&quot;date-outer&quot;&gt;
    </b:if>
    <b:if cond='data:post.dateHeader'>
      <h2 class='date-header'><span><data:post.dateHeader/></span></h2>
    </b:if>
    <b:if cond='data:post.isDateStart'>
      &lt;div class=&quot;date-posts&quot;&gt;
    </b:if>
    <div class='post-outer'>
      <b:include data='post' name='post'/>
      <b:include cond='data:blog.pageType in {&quot;static_page&quot;,&quot;item&quot;}' data='post' name='comment_picker'/>
    </div>

任何帮助都非常感谢并提前感谢!

【问题讨论】:

    标签: javascript templates blogs blogger


    【解决方案1】:

    无论如何,您的代码都不完整,请将&lt;b:include data='post' name='post'/&gt; 行替换为下一个条件。此代码将仅在索引页面上显示帖子标题。

    <b:if cond='data:blog.pageType == "index"'>
      <b:if cond='data:post.title'>
        <h3 class='post-title'>
          <a expr:href='data:post.url'><data:post.title/></a>
        </h3>
      </b:if>
    <b:else/>
      <b:include data='post' name='post'/>
    </b:if>
    

    【讨论】:

    • 谢谢,这只是我认为与主题相关的代码片段,抱歉,它不完整,但感谢您的回复,我现在就试一试。跨度>
    猜你喜欢
    • 1970-01-01
    • 2014-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-05
    • 2021-01-26
    • 2014-01-10
    相关资源
    最近更新 更多