简体   繁体   English

要在父侧边栏中显示的Wordpress链接项目

[英]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.

相关问题 WordPress仅在侧边栏上显示第一个父级及其子菜单 - Wordpress display first parent and its sub-menu only on sidebar 如何在wordpress页面上显示当前菜单在侧边栏上显示父菜单和子菜单 - How to display current manu on wordpress page display parent and sub-menu fo on sidebar 在Wordpress边栏中显示Unicode字符 - Display Unicode character in Wordpress sidebar 小部件/边栏中的WordPress显示帖子 - WordPress display posts in widget/sidebar 仅在 wordpress 小部件侧边栏中显示基于所选父类别的 Woo Commerce 子类别 - Only display Woo Commerce sub-categories based on selected Parent Category in a wordpress widget sidebar 获取类别小部件的Wordpress侧栏中的类别链接 - get category link in Category Widget Wordpress sidebar WordPress问题:侧边栏允许链接扩展到页脚 - Wordpress Issue: Sidebar is allowing for link to expand into the footer WordPress主题调试:插件侧边栏导致原始侧边栏不显示 - Wordpress Theme Debug: Plugin sidebar causes original sidebar not to display 在侧边栏中显示最近的帖子,并在 wordpress 中显示帖子缩略图 - display recent post in sidebar with post thumbnail in wordpress WordPress主题TwentyThirteen php-需要不显示侧边栏 - WordPress Theme TwentyThirteen php - need to not display sidebar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM