首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >博主值得注意的模板-下一篇文章和前一篇文章按钮缺失

博主值得注意的模板-下一篇文章和前一篇文章按钮缺失
EN

Stack Overflow用户
提问于 2018-05-21 00:19:44
回答 1查看 1.1K关注 0票数 0

在一个更新的Google模板中,当您查看博客帖子时,Notable,不存在Next ArticlePrevious Article按钮。

这个职位解释了如何在博客主页中添加分页按钮以查看下一篇文章列表和上一篇文章列表,但没有在博客文章中添加类似的按钮来查看下一篇文章和上一篇文章。

带有分页的主博客页面示例

需要分页的博客文章示例(用粉红突出显示)

知道如何添加此功能吗?我只是想在个人博客文章中添加“上一篇文章”和“下一篇文章”按钮。

编辑更新的图片,希望更清晰。

EN

回答 1

Stack Overflow用户

发布于 2018-05-21 16:40:08

我相信我找到了答案。只是需要添加

代码语言:javascript
复制
        <b:if cond='data:blog.pageType == "item"'>
          <b:include cond='data:newerPageUrl' name='previousPageLink'/>
          <b:include cond='data:olderPageUrl' name='nextPageLink'/>
        </b:if>

在此代码中

代码语言:javascript
复制
      <div class='post-bottom'>
        <div class='post-footer'>
          <!-- Footer bylines -->
          <b:include name='footerBylines'/>
        </div>
          <b:include cond='data:view.isSingleItem and data:widget.type == &quot;Blog&quot;' data='{ shareButtonClass: &quot;post-share-buttons-bottom&quot;, overridden: true }' name='maybeAddShareButtons'/>
          <b:include cond='data:view.isMultipleItems or data:widget.type == &quot;PopularPosts&quot;' data='post' name='postJumpLink'/>
      </div>

就像这样

代码语言:javascript
复制
      <div class='post-bottom'>
        <div class='post-footer'>
          <!-- Footer bylines -->
          <b:include name='footerBylines'/>
        </div>
          <b:include cond='data:view.isSingleItem and data:widget.type == &quot;Blog&quot;' data='{ shareButtonClass: &quot;post-share-buttons-bottom&quot;, overridden: true }' name='maybeAddShareButtons'/>
          <b:include cond='data:view.isMultipleItems or data:widget.type == &quot;PopularPosts&quot;' data='post' name='postJumpLink'/>
          <b:if cond='data:blog.pageType == "item"'>
            <b:include cond='data:newerPageUrl' name='previousPageLink'/>
            <b:include cond='data:olderPageUrl' name='nextPageLink'/>
          </b:if>
      </div>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50440539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档