始终在侧边栏中显示所有子页
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了始终在侧边栏中显示所有子页相关的知识,希望对你有一定的参考价值。
<?php // paste this in functions.php function wpe_highest_ancestor(){ global $post; $child_of = $page_ancestors; }else{ $child_of = $post->ID; } return $child_of; } ?> This is for the template ------------------------------- <ul class="sidebar"> <?php wp_list_pages('child_of=' . wpe_highest_ancestor()); ?> </ul> If you want to have the name of the top-level page in the sidebar, you can use the following code: <ul class="sidebar"> <?php $child_of = wpe_highest_ancestor(); wp_list_pages('child_of='.$child_of.'&title_li=<h5>'.esc_attr(get_the_title($child_of)).'</h5>'); ?> </ul>
以上是关于始终在侧边栏中显示所有子页的主要内容,如果未能解决你的问题,请参考以下文章
python #SublimeText #Sublime:自动在侧边栏中显示文件