Blogger页面正文/内容重复两次

时间:2014-08-16 04:41:56

标签: xml blogger blogspot

我的博主博客在Pages中重复两次内容。它仅显示在Pages中。怎么解决这个问题?

1 个答案:

答案 0 :(得分:0)

昨天我遇到了同样的问题。

也许博主在他们的最后做了些什么。 我找到了解决问题的方法。

转到您的模板。先备份。编辑HTML

发送此代码

   <div class='date-posts'>
            <div class='post-outer'>
              <div class='post hentry uncustomized-post-template' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'>
                <b:if cond='data:post.thumbnailUrl'>
                  <meta expr:content='data:post.thumbnailUrl' itemprop='image_url'/>
                </b:if>
                <meta expr:content='data:blog.blogId' itemprop='blogId'/>
                <meta expr:content='data:post.id' itemprop='postId'/>
                <a expr:name='data:post.id'/>
                <b:if cond='data:post.title'>
                  <h3 class='post-title entry-title' itemprop='name'>
                    <b:if cond='data:post.link'>
                      <a expr:href='data:post.link'>
                        <data:post.title/>
                      </a>
                      <b:else/>
                      <b:if cond='data:post.url'>
                        <b:if cond='data:blog.url != data:post.url'>
                          <a expr:href='data:post.url'>
                            <data:post.title/>
                          </a>
                          <b:else/>
                          <data:post.title/>
                        </b:if>
                        <b:else/>
                        <data:post.title/>
                      </b:if>
                    </b:if>
                  </h3>
                </b:if>
                <div class='post-header'>
                  <div class='post-header-line-1'/>
                </div>
                <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' itemprop='articleBody'>
                  <data:post.body/>
                  <div style='clear: both;'/>
                  <!-- clear for photos floats -->
                </div>
                <div class='post-footer'>
                  <div class='post-footer-line post-footer-line-1'>
                    <span class='post-author vcard'>
                      <b:if cond='data:top.showAuthor'>
                        <b:if cond='data:post.authorProfileUrl'>
                          <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
                            <meta expr:content='data:post.authorProfileUrl' itemprop='url'/>
                            <a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
                              <span itemprop='name'>
                                <data:post.author/>
                              </span>
                            </a>
                          </span>
                          <b:else/>
                          <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
                            <span itemprop='name'>
                              <data:post.author/>
                            </span>
                          </span>
                        </b:if>
                      </b:if>
                    </span>
                    <span class='post-timestamp'>
                      <b:if cond='data:top.showTimestamp'>
                        <data:top.timestampLabel/>
                        <b:if cond='data:post.url'>
                          <meta expr:content='data:post.canonicalUrl' itemprop='url'/>
                          <a class='timestamp-link' expr:href='data:post.url' rel='bookmark' title='permanent link'>
                            <abbr class='published' expr:title='data:post.timestampISO8601' itemprop='datePublished'>
                              <data:post.timestamp/>
                            </abbr>
                          </a>
                        </b:if>
                      </b:if>
                    </span>
                    <span class='post-comment-link'>
                      <b:if cond='data:blog.pageType != &quot;item&quot;'>
                        <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
                          <b:if cond='data:post.allowComments'>
                            <b:include data='post' name='comment_count_picker'/>
                          </b:if>
                        </b:if>
                      </b:if>
                    </span>
                  </div>
                  <div class='post-footer-line post-footer-line-2'>
                    <b:if cond='data:top.showMobileShare'>
                      <div class='mobile-link-button goog-inline-block' id='mobile-share-button'>
                        <a href='javascript:void(0);'>
                          <data:shareMsg/>
                        </a>
                      </div>
                    </b:if>
                    <b:if cond='data:top.showDummy'>
                      <div class='goog-inline-block dummy-container'>
                        <data:post.dummyTag/>
                      </div>
                    </b:if>
                  </div>
                </div>
              </div>
              <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
                <b:include data='post' name='comment_picker'/>
              </b:if>
              <b:if cond='data:blog.pageType == &quot;item&quot;'>
                <b:include data='post' name='comment_picker'/>
              </b:if>
            </div>
          </div>

在第1行上方添加此

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

并在最后一行之后添加此

 </b:if>

所以修改后的代码将是

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
   <div class='date-posts'>
            <div class='post-outer'>
              <div class='post hentry uncustomized-post-template' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'>
                <b:if cond='data:post.thumbnailUrl'>
                  <meta expr:content='data:post.thumbnailUrl' itemprop='image_url'/>
                </b:if>
                <meta expr:content='data:blog.blogId' itemprop='blogId'/>
                <meta expr:content='data:post.id' itemprop='postId'/>
                <a expr:name='data:post.id'/>
                <b:if cond='data:post.title'>
                  <h3 class='post-title entry-title' itemprop='name'>
                    <b:if cond='data:post.link'>
                      <a expr:href='data:post.link'>
                        <data:post.title/>
                      </a>
                      <b:else/>
                      <b:if cond='data:post.url'>
                        <b:if cond='data:blog.url != data:post.url'>
                          <a expr:href='data:post.url'>
                            <data:post.title/>
                          </a>
                          <b:else/>
                          <data:post.title/>
                        </b:if>
                        <b:else/>
                        <data:post.title/>
                      </b:if>
                    </b:if>
                  </h3>
                </b:if>
                <div class='post-header'>
                  <div class='post-header-line-1'/>
                </div>
                <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' itemprop='articleBody'>
                  <data:post.body/>
                  <div style='clear: both;'/>
                  <!-- clear for photos floats -->
                </div>
                <div class='post-footer'>
                  <div class='post-footer-line post-footer-line-1'>
                    <span class='post-author vcard'>
                      <b:if cond='data:top.showAuthor'>
                        <b:if cond='data:post.authorProfileUrl'>
                          <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
                            <meta expr:content='data:post.authorProfileUrl' itemprop='url'/>
                            <a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
                              <span itemprop='name'>
                                <data:post.author/>
                              </span>
                            </a>
                          </span>
                          <b:else/>
                          <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
                            <span itemprop='name'>
                              <data:post.author/>
                            </span>
                          </span>
                        </b:if>
                      </b:if>
                    </span>
                    <span class='post-timestamp'>
                      <b:if cond='data:top.showTimestamp'>
                        <data:top.timestampLabel/>
                        <b:if cond='data:post.url'>
                          <meta expr:content='data:post.canonicalUrl' itemprop='url'/>
                          <a class='timestamp-link' expr:href='data:post.url' rel='bookmark' title='permanent link'>
                            <abbr class='published' expr:title='data:post.timestampISO8601' itemprop='datePublished'>
                              <data:post.timestamp/>
                            </abbr>
                          </a>
                        </b:if>
                      </b:if>
                    </span>
                    <span class='post-comment-link'>
                      <b:if cond='data:blog.pageType != &quot;item&quot;'>
                        <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
                          <b:if cond='data:post.allowComments'>
                            <b:include data='post' name='comment_count_picker'/>
                          </b:if>
                        </b:if>
                      </b:if>
                    </span>
                  </div>
                  <div class='post-footer-line post-footer-line-2'>
                    <b:if cond='data:top.showMobileShare'>
                      <div class='mobile-link-button goog-inline-block' id='mobile-share-button'>
                        <a href='javascript:void(0);'>
                          <data:shareMsg/>
                        </a>
                      </div>
                    </b:if>
                    <b:if cond='data:top.showDummy'>
                      <div class='goog-inline-block dummy-container'>
                        <data:post.dummyTag/>
                      </div>
                    </b:if>
                  </div>
                </div>
              </div>
              <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
                <b:include data='post' name='comment_picker'/>
              </b:if>
              <b:if cond='data:blog.pageType == &quot;item&quot;'>
                <b:include data='post' name='comment_picker'/>
              </b:if>
            </div>
          </div>
        </b:if>

并保存模板