[英]Wordpress Link Items to Display in Parent Sidebar
I have created a menu like so... http://tinyurl.com/p5xr852 我创建了像这样的菜单... http://tinyurl.com/p5xr852
You can see I have added links under "What's Happening?" 您可以看到我在“正在发生什么?”下添加了链接。 which I want to use as page anchors from a sidebar.
我想将其用作侧边栏的页面定位点。
What I need to do is have these items list in a sidebar when on the parent page. 我需要做的是在父页面上的边栏中列出这些项目。
I have done a heap of research and found that wp_get_links
is now deprecated (see here http://codex.wordpress.org/Function_Reference/get_links ) 我进行了大量研究,发现不建议使用
wp_get_links
(请参阅此处http://codex.wordpress.org/Function_Reference/get_links )
Apparently this has now been replaced with wp_list_bookmarks()
显然,现在已将其替换为
wp_list_bookmarks()
Is there any way what so ever to do this? 有什么办法可以做到这一点吗? I don't want to go down the route of creating a heap of multiple menu's as I will be adding these links under post pages to act as page anchors.
我不想沿着创建多个菜单堆的路走下去,因为我将在帖子页面下添加这些链接以充当页面锚点。
I hope I understood correctly. 我希望我能正确理解。 You want that list of links displaying on the sidebar, when the user is in "What's Happening" -page OR any of it's child-pages?
当用户位于“正在发生什么”页面或其中的任何子页面中时,您希望该链接列表显示在侧栏上吗?
If I didin't understand then just skip this but. 如果我听不懂,那就跳过。
Create a new text widget that has your pages as a list like this: 创建一个新的文本小部件,将您的页面作为如下列表:
<ul>
<li><a href="#">Overview</a></li>
<li><a href="#">Schedule</a></li>
<li><a href="#">etc</a></li>
<li><a href="#">etc</a></li>
<li><a href="#">etc</a></li>
<li><a href="#">etc</a></li>
</ul>
Then get the Widget Logic plugin: http://wordpress.org/plugins/widget-logic/ This plugin allows you to choose where widgets appear, for example in certain pages, in archives, in certain languages, in child-pages etc. Check out: http://wordpress.org/plugins/widget-logic/other_notes/ on how to make this link-list-navigation-widget to appear on the pages you want it to. 然后获取Widget Logic插件: http : //wordpress.org/plugins/widget-logic/此插件可让您选择在某些页面,档案库,某些语言,子页面等中显示窗口小部件的位置。查看: http : //wordpress.org/plugins/widget-logic/other_notes/有关如何使此link-list-navigation-widget出现在您想要的页面上的信息。
It's something like 就像
global $post; return (is_page('15') || ($post->post_parent=="15"));
You put the ID of the page on which you want the widget to appear on. 您输入要在其上显示窗口小部件的页面的ID。 And its child-pages with the latter.
以及与后者的子页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.