WordPress wp_list_pages:列出父页面兄弟姐妹
我现在正在努力让它工作一段时间。我很接近,但找不到可行的解决方案。
我的页面结构是这样的:
1 FIRST LEVEL
2 SECOND LEVEL
3 THIRD LEVEL
4 CAR
5 SUV
5 MINIVAN
5 FULLSIZE
4 MOTORCYCLE
4 BICYCLE
2 SECOND LEVEL
2 SECOND LEVEL
1 FIRST LEVEL
我需要一个 wp_list_pages 语句来执行以下操作:在第 4 级和第 5 级页面上(并且仅在这些页面上),导航列出所有第 4 级页面。
(当我在“汽车”页面上时,导航应该是汽车,摩托车,自行车。而且当我在迷你货车页面上时,导航应该是汽车,摩托车,自行车。)
非常感谢您的帮助!
I'm trying to get this working for quite a while now. I get close but can't find a working solution.
My page structure is like this:
1 FIRST LEVEL
2 SECOND LEVEL
3 THIRD LEVEL
4 CAR
5 SUV
5 MINIVAN
5 FULLSIZE
4 MOTORCYCLE
4 BICYCLE
2 SECOND LEVEL
2 SECOND LEVEL
1 FIRST LEVEL
I need a wp_list_pages statement that does the following: on 4th and 5th level pages (and ONLY on those) the navigation lists all 4th level pages.
(When i'm on page "CAR" the navigation should be CAR,MOTORCYCLE,BICYCLE. And also when i'm on page MINIVAN the navigation should be CAR,MOTORCYCLE,BICYCLE.)
Thank you very much for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您有任何不确定的地方,请随时询问:)
Feel free to ask if you're unsure of anything :)
这是我最终使用的代码,感谢 TheDeadMedic 的回答。 (我取消了一页级别,所以它是第三和第四级别)
Here's the code i finally used, thanks to TheDeadMedic's answer. (I canceled one page level so it's for 3rd and 4th level)