它是否可以在WordPress中导航风格?

时间:2012-03-20 08:21:20

标签: wordpress content-management-system navigation structure

任何人都可以告诉我双导航风格是否容易实现或不可能。我联系的WordPress开发人员告诉我它不是。

基本上,我们希望导航通过网页顶部的链接(附图中的椅子),还要在页面左侧引入子导航(附件中的垂直标签) )。

因此,如果您在HOME部分,左侧有3个选项卡,将HOME分为3个子部分。如果您单击另一个顶部链接并转到XYZ部分,则左侧的选项卡会有所不同,以提供XYZ的子部分。

我知道它显然可以从HTML的角度来看,但是这个人说它不可能这样做,同时保持内容在WordPress中可编辑为Pages等。

我希望所有主要页面及其子内容都可以通过WordPress CMS进行编辑。

可能?感谢

screenshot

2 个答案:

答案 0 :(得分:1)

您可以创建2个自定义菜单标题&边吧。对于每个标题菜单的子项给出不同的类。现在基于活动页面ID使用jQuery启用子菜单类来显示它。

答案 1 :(得分:0)

您的顶级菜单可以是标准的wordpress菜单,没有任何其他链接(没有下拉菜单或子链接),然后查询并获取您当前页面的所有直接子项并将这些页面显示为链接。您可以在侧栏中使用此代码,并将其包含在具有侧面导航的所有模板页面上。

<?php $args = array(
'child_of' => $post->ID, //get all children of current page
'sort_order' => 'ASC',
'sort_column' => 'post_title',
'parent' => $post->ID,  //get all children that have a parent of the current page.  This will return only the children pages not grandchildren.
'post_type' => 'page',
'post_status' => 'publish'
);

$sub_pages = get_pages( $args ); 
//then loop through the $sub_pages array and display the links as needed
?>