Wordpress-自定义字段&;wp_导航菜单
我想在主页的内容中添加特定父页面的子页面列表。为此,我尝试在自定义字段中添加Wordpress-自定义字段&;wp_导航菜单,wordpress,menu,Wordpress,Menu,我想在主页的内容中添加特定父页面的子页面列表。为此,我尝试在自定义字段中添加wp\u nav\u菜单,但没有成功 请建议检查以下代码是否适合您 http://wordpress.org/support/topic/including-the-parent-page-in-a-list-of-subpages <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$po
wp\u nav\u菜单
,但没有成功
请建议检查以下代码是否适合您
http://wordpress.org/support/topic/including-the-parent-page-in-a-list-of-subpages
<?php
if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) {
$parent_title = get_the_title($post->post_parent);?>
<li><a href="<?php echo get_permalink($post->post_parent) ?>"><?php echo $parent_title;?></a></li>
<?php echo $children; ?>
<?php } ?>
http://wordpress.org/support/topic/including-the-parent-page-in-a-list-of-subpages
感谢您的及时回复-但我在主页产品上有3个专栏,关于,地址,我正试图通过自定义字段来完成。对于产品,我需要查看wp_nav_菜单。