wordpress给新文章添加NEW图标
<?php
$t1=$post->post_date;
$t2=date("Y-m-d H:i:s");
$diff=(strtotime($t2)-strtotime($t1))/3600;
if($diff<72){echo "<img src='https://https://www.lilianhua.com/wp-content/themes/wp-meliora-master/ico/new.svg' alt='3天之内的文章'>";}?>
将以上代码添加到index.php文件的适合位置
🏆 每日挑战:你知道答案吗?
在 PowerShell 中,如何使用 `Invoke-WebRequest` 获取网页内容?
温馨提示 : 非特殊注明,否则均为©李联华的博客网原创文章,本站文章未经授权禁止任何形式转载;IP地址:3.145.96.41,归属地:俄亥俄州Dublin ,欢迎您的访问!
文章链接:https://www.lilianhua.com/wordpress-adds-a-new-icon-to-a-new-article.html
文章链接:https://www.lilianhua.com/wordpress-adds-a-new-icon-to-a-new-article.html