子比主题美化-新发布文章列表角标

综合评论9,410,666字数 79阅读0分15秒

在主题目录 func.php 文件添加如下代码。

复制代码
  1. /*新文章发布角标 blog.zbiwl.com*/
  2. function add_zbfox_new_post_label($title, $id) {
  3. if (!is_admin() && !is_single()) {
  4. $post_time = get_the_time('U', $id);
  5. if (time() - $post_time <= 24 * 60 * 60) {
  6. $title .= ' <div class="zbfox_new_post_label">NEW</div>';
  7. }
  8. }
  9. return $title;
  10. }
  11. add_filter('the_title', 'add_zbfox_new_post_label', 10, 2);
文章源自小武站https://1z345.cn/小武站-https://bbs.50-0.cn/731.html文章源自小武站https://1z345.cn/小武站-https://bbs.50-0.cn/731.html
添加微语页面
添加微语页面 综合

添加微语页面

美化教程1、首先在子比主题目录的functions.php里面加入以下代码://微语 add_action('init', 'my_custom_init'); function my_custom_...
  • 本文由 admin 发表于2024年8月14日 00:18:31
  • 转载请务必保留本文链接:https://bbs.50-0.cn/731.html
匿名

发表评论

匿名网友
确定