WordPress企业主题定制/开发/优化

wordpress设置页面当前位置导航的方法

首页 » WORDPRESS主题技术 » wordpress设置页面当前位置导航的方法

<div style="font-size:10px; text-align:right">
<a href="<?php echo get_option('home'); ?>/">Etusivu</a> »
<?
if ($post->post_parent) // if have parent pages
{
$ancestors=get_post_ancestors($post->ID);// get parent's page ID to an array
$root=count($ancestors)-1; // get top parent's page ID index at array
for($i=$root;$i>-1;$i--) // output the array with links for all parent pages
{
?>
<a href="<?php echo get_page_link($ancestors[$i]); //output page link  ?>"><?=get_the_title($ancestors[$i])//output page title?></a> »
<?
}
}
the_title();
?>
</div>

相关项目

  • WordPress外贸企业主题

  • 最近更新

  • 热门标签