Home > Backend Development > PHP Tutorial > wordpress二级分类下的文章页怎么设置“上一篇”

wordpress二级分类下的文章页怎么设置“上一篇”

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:22:54
Original
1359 people have browsed it

在一级分类文章页设置文章的“上一篇”和“下一篇”可以使用下面的代码:

<code><?php previous_post_link("上一篇: %link","%title",true); <br>next_post_link("下一篇: %link","%title",true); ?> </code>
Copy after login
Copy after login

如果使用上面的代码,二级分类文章页的“上一篇”和“下一篇”显示的是一级分类(二级分类的父分类)下的文章序列。
如果想二级分类文章页的“上一篇”和“下一篇”只显示二级分类下的文章,要怎么做呢?

回复内容:

在一级分类文章页设置文章的“上一篇”和“下一篇”可以使用下面的代码:

<code><?php previous_post_link("上一篇: %link","%title",true); <br>next_post_link("下一篇: %link","%title",true); ?> </code>
Copy after login
Copy after login

如果使用上面的代码,二级分类文章页的“上一篇”和“下一篇”显示的是一级分类(二级分类的父分类)下的文章序列。
如果想二级分类文章页的“上一篇”和“下一篇”只显示二级分类下的文章,要怎么做呢?

这个你可以参考免费资源部落的一篇文章:
WordPress文章中添加上一篇、下一篇链接专题研究

这里介绍了怎么实现上一篇下一篇显示同分类的文章。

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template