我使用此代码显示父级的子页面列表:
<?php
global $post; // Setup the global variable $post
if ( is_page() && $post->post_parent ) {
// Make sure we are on a page and that the page is a parent.
$kiddies = wp_list_pages( \'sort_column=menu_order&title_li=&child_of=\' . $post->post_parent . \'&echo=0\' );
} else {
$kiddies = wp_list_pages( \'sort_column=menu_order&title_li=&child_of=\' . $post->ID . \'&echo=0\' );
}
if ( $kiddies ) {
echo \'<ul class="secondary">\';
echo $kiddies;
echo \'</ul>\';
}
我想能够自定义链接的锚文本。e、 g.如果子页面名称为“blue”,我想在末尾附加“widget”,以使锚定为“blue widget”。有人能帮忙吗?
谢谢