如下
get_header();
if ( is_home() ) {
// This is the blog posts indexecho '首頁(yè)';
echo '
?';
} else {
// This is not the blog posts indexecho '其它頁(yè)';
}
?>

簡(jiǎn)單的if判斷,如果是首頁(yè),執(zhí)行第一個(gè),輸出“首頁(yè)”,并應(yīng)用該樣式。
非首頁(yè),則輸出“其它頁(yè)”。
采用頁(yè)級(jí)CSS,會(huì)覆蓋外鏈的CSS樣式,達(dá)到修改效果
這個(gè)方法只是能用,并不完美。
參考鏈接:
https://developer.wordpress.org/reference/functions/is_home/