判斷代碼,根據判斷啟用指定頁面
<?php get_header(); //判斷首頁
????????if ( is_home() ) {//是
//輸出日志標題
????????????????if ( is_singular() ) :
????????????????????????
????????????????????????the_title( '<ul class="entry-title"><li>', '</li></ul>' );
????????????????????????
????????????????else :
????????????????????????
????????????????????????the_title( '<ul class="entry-title"><li><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></li></ul>' );
????????????????endif;
????????} else {//否
get_template_part( 'content', get_post_type() );
????????
}
?>
頂頂頂