WordPress 自定义帖子类型显示在档案/博客下?但我不想让他们这么做?
http://weddings.agapewith.us/photos/caleb-promise
注意页面出现在博客下。它们是自定义帖子类型的照片,因此我想将每个帖子显示为照片的子级。怎么了?
http://weddings.agapewith.us/photos/caleb-promise
Notice the page appears under blog. They are a custom post-type of photos so I want to show each posting as children of photos. What is happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最终做的是使用条件判断该项目是否是自定义帖子类型,如果是,则将 CSS 类添加到正文中。使用 CSS 类,我取消突出显示博客并突出显示 post-type-parent
What I ended up doing is using conditionals to figure out if the item was a custom-post-type and if so a CSS class is added to the body. Using the CSS class I un-highlighted the blog and highlighted the post-type-parent
类“current_page_parent”当前附加到博客菜单项。您可以像我下面所做的那样将其移动到“照片”菜单项吗?这应该可以解决你的问题。
菜单项的 CSS 样式由绑定到菜单的众多类名决定。通过移动它们,您可以有效地将不同的 CSS 规则应用于不同的元素。
The class "current_page_parent" is currently attached to the Blog menu item. Can you move it to the Photo menu item as I've done below? This should fix your problem.
The CSS styling for the menu items is determined by the numarous class names that are bound to the menus. By moving them around, you effectively apply different CSS rules to different elements.