Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在以下代码的结束标记之前插入另一个自动生成的 UL:
<?php wp_list_pages('include=4&title_li='); ?>
我希望它像 link_after 一样运行,只是它必须是 li_after (不幸的是不存在?
你知道我该怎么做吗?
在你的functions.php中添加这个:
class List_Append extends Walker_Page { function end_el(&$output, $page, $depth) { $output .= "</li>"; $output .= "your_ul_here"; } }
然后像这样调用:
wp_list_pages(array('include' => '4', 'title_li' => '', 'walker' => new List_Append()));