在function.php添加以下代码,然后字节调用:<div><?php wodeweizhi(); ?></div> function wodeweizhi() { if (!is_home()) { echo '<a href="'; echo home_url(); echo '">'; _e( '首页' ); echo "</a> <em>»</em> "; if (is_category() || is_single()) { single_cat_title(); if (is_single()) { the_category(', '); echo " » "; the_title(); } } elseif (is_page()) { echo the_title(); } elseif (is_tag()) { echo 'Posts tagged with "'; single_tag_title(); echo '"'; } elseif (is_day()) {echo "Archive for "; the_time(' F jS, Y');} elseif (is_month()) {echo "Archive for "; the_time(' F, Y');} elseif (is_year()) {echo "Archive for "; the_time(' Y');} elseif (is_author()) {echo "Author Archive";} elseif (is_search()) {echo "Search Results";} } } CSS: #weizhi{ height:30px; background:#f00; font-weight:bold; font-color:#000; } #weizhi a:hover{ color:ff0;}
转载于:https://blog.51cto.com/njyanglinghui/729243