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

簡單的if判斷,如果是首頁,執行第一個,輸出“首頁”,并應用該樣式。
非首頁,則輸出“其它頁”。
采用頁級CSS,會覆蓋外鏈的CSS樣式,達到修改效果
這個方法只是能用,并不完美。
參考鏈接:
https://developer.wordpress.org/reference/functions/is_home/