WordPress Article New Icon
博客在首頁的左上角都會有個」new」圖示顯示,
雖然這個功能的實用性不大,但是對於喜歡搗鼓 WordPress 博客的朋友,
應該興趣不小吧,
下面博客吧介紹一下實現最新文章添加」new」圖示的方法步驟,操作很簡單。
WordPress 最新文章添加」new」icon :
1.登陸WordPress 博客後臺,點擊「外觀」選項卡下的「編輯」選項進入主題編輯介面
2.選擇index.php檔進行編輯操作,在代碼後面添加以下代碼
$t2=date(“Y-m-d H:i:s”);
$diff=(strtotime($t2)-strtotime($t1))/3600;
if($diff<72){echo “”;}?>