在 WordPress 中创建类别帖子的下拉菜单
我正在为朋友开发这个网站www.annapogossova.com。
目前,菜单导航正在通过我创建的每个画廊的页面运行。
当需要扩展网站时 - 我希望它相当动态,以便每个画廊页面/帖子都会自动添加到下拉菜单中,而她没有不必编辑 nav.php 文件即可让它们正确显示。
当然有解决办法吗?我可能以错误的方式进行了设置 - 我应该将画廊创建为帖子而不是页面吗?
如果页面没问题 - 有没有办法更好地工作菜单,以便它列出每个类别下的页面?
我觉得如果所有画廊都是一个类别中的帖子,那么将来效果会更好?
所以目前的 WordPress 结构是:
Nav text is html > ul& li 手动创建导航列表页面 >带有 iframe 的页面(每个新画廊)
这就是 nav.php 当前的样子
- 编辑,我不能发布超过 1 个链接.. 抱歉
I'm working on this site www.annapogossova.com for a friend.
Currently the menu navigation is running through Pages i've created each gallery in.
When it comes time to expand the site - I want it to be fairly dynamic so that each gallery page/post is added to the drop down menu automatically and she doesn't have to edit the nav.php file in order to get them to show correctly.
Surely there is a work around for this? I may have gone about the setup the wrong way - should I have created the galleries as Posts and not Pages?
If Pages are alright - is there a way to work the menu better so that it lists the Pages under each category?
I feel it would work a lot better in the future if all the galleries were Posts in a category??
So the Wordpress Structure is currently:
Nav text is html > ul & li creates nav list pages manually > Page (each new gallery) with an iframe
This is what the nav.php currently looks like
-Edit, I can't post more than 1 link.. sorry
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
页面适合您正在做的事情。为每个顶级导航项创建一个页面。接下来,为每个子级别创建子页面(即在管理控制台中设置其父页面)。您最终会得到如下所示的页面结构:
然后在 nav.php 中,您可以使用以下方法将所有内容输出到
结构中:
上述文档方法在这里。
Pages are fine for what you're doing. Create a page for each of the top level navigation items. Next, create sub pages for each sub level (i.e. set their page parent in the admin console). You'll end up with a page structure that looks like the following:
Then in your nav.php you can output this all in a
<ul>
structure with the following method:The documentation on the above method is here.