我正在使用add_rewrite_rule()函数来修改我的URL结构。
我想使用add_rewrite_rule添加自定义规则,但只有在我的固定链接设置区域中选择了默认设置以外的其他设置时,才会添加这些规则。
即在设置中有以下选项:
- Default http://localhost/wordpress/?p=123
- Day and name http://localhost/wordpress/2014/08/14/sample-post/
- Month and name http://localhost/wordpress
我知道大多数人都遇到过这种problem.With分页,第一个页面显示正确,第二个页面链接像‘-page /paged/2/’-page not found .And我的问题是,虽然它是在wordpress中,但我在页面上显示的不是来自某个类别的帖子内容,我的数据库中有一个表,其中存储了一些注册信息,这些信息将显示在我的website.The查询上是如此正常,就像我们对php网站所做的那样
select * from registration
我所做的是一个普通的php分页,但是当涉及到链接wordpress分页时,affects.what不需要在我的permalink自定义结构.P
我的文章分页在不工作的WordPress 5.5中,所以,我想重写分页的网址。I使用内页中带有分页的帖子和段塞“post”。
Current URL (The Pagination): domain.com/blog/2
I want to change the URL to: domain.com/blog/page/2
通过更改URL,posts分页开始工作。我添加了jQuery代码,分页工作,但是我如何在WordPress中做到这一点。
函数s.php中添加的My代码:
function my_pagination_rewrite() {
add_rewrite_rule(