我在wordpress wp-clear主題中遇到了一個問題,single.php在index.php中不會加載在header.php中聲明的導航欄。我還在single.php的頂部添加了<?php get_header(); ?>
。像header.php中定義爲這個http://wordpress.org/support/topic/get_header-call-not-working-except-in-indexphp, 導航部分同樣的問題:wp-clear主題函數不能在single.php中工作?
<?php if (get_option('solostream_show_catnav') == 'yes' ) { ?>
<div id="catnav">
<div class="limit clearfix">
<?php if (function_exists('wp_nav_menu')) { ?>
<ul class="clearfix">
<?php wp_nav_menu(array('container'=>false,'theme_location'=>'catnav','fallback_cb'=>'catnav_fallback','items_wrap'=>'%3$s')); ?>
<li class="rss-comments"><a title="<?php _e("Comments RSS Feed", "solostream"); ?>" href="<?php bloginfo('comments_rss2_url'); ?>">Comments</a></li>
<li class="rss-content"><a title="<?php _e("Posts RSS Feed", "solostream"); ?>" href="<?php bloginfo('rss2_url'); ?>">Posts</a></li>
</ul>
<?php } else { ?>
<ul class="clearfix"><?php wp_list_categories('title_li='); ?></ul>
<?php } ?>
</div>
</div>
<?php } ?>
注:實際上它打印HTML輸出像
<div id="catnav">
<div class="limit clearfix">
<ul class="clearfix">
<li id="menu-item-17" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-17"><a href="/"></a></li>
</ul>
</div>
</div>
它正在打印導航欄 - 只是沒有通過它的外觀添加導航項目 – matpol 2012-04-14 08:11:29
當然,它不打印菜單項... – Bheem 2012-04-14 08:15:13
是否有任何項目? – matpol 2012-04-14 08:19:56