如果想在wordpress 父页面中显示子页面列表链接,可以通过下面的代码实现,下面由wordpress教程栏目给大家介绍。

WordPress 父页面中显示子页面列表将下面的代码添加到当前主题 functions.php 中:
function wpb_list_child_pages() {
global $post;
if ( is_page() && $post->post_parent )
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );
else
$childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );
if ( $childpages ) {
$string = '- ' . $childpages . '
之后,可以使用短代码:
[wpb_childpages]
加到文本小工具中。
默认文本小工具不支持短代码,可以将:
康通B2C网站管理系统康通购物网KtShopV1.5(Struts2+Hibernate+Spring+MySQL)版采用当前最流行的技术平台。前台:1、会员功能:注册会员,修改会员资料;登录系统后可以选购商品,放入购物车(修改购物数量、删除购物车里的内容),继续购物,最后确认下订单,在线支付(支付宝/财付通/网银在线)所选商品所选商品所需支付的金额;2、新闻频道功能:最新新闻,新闻列表及页面显示
add_filter('widget_text', 'do_shortcode');添加到当前主题 functions.php 中,让文本小工具支持短代码。
也可以将下面的代码添加到主题页面模板适当的位置:
比如新建一个页面模板,将代码加进去,只在使用该功能时,选择新建的页面模板。










