狐狸聚合登录,欢迎各位站长接入!

WordPress子比主题美化教程合集【持续更新】



图片[1] - WordPress子比主题美化教程合集【持续更新】 - 狐狸资源网

小工具 – HTML

    <div style="display: flex; align-items: center; background: #fff; padding: 10px; border-radius: 8px; height: 80px;">
    <div class="ant-ai-img"><a href="https://www.emyi.cn/archive" target="_blank">
        <img src="https://www.ghxi.com/wp-content/plugins/gh-ai/static/img/earth.svg" style="box-shadow:none"></a>
    </div>
    <div style="display: flex; align-items: center;" class="ant-ai-body">
           <span style="font-size: 20px; margin-right: 20px"> 蚂蚁AI持续更新检测中</span>
           <span style="font-size: 16px; margin-right: 10px">检测软件数量:<span id="tj_rzzs" style="color: red">0</span></span>
            <span style="font-size: 16px; margin-right: 10px">今日更新:<span id="tj_update_24h" style="color: green">0</span></span>
    </div>
			
    </div>

<script type="text/javascript">
    // 将变量值显示到对应的 HTML 元素中
    document.addEventListener('DOMContentLoaded', function() {
        document.getElementById('tj_rzzs').textContent = tj_rzzs;
 document.getElementById('tj_update_24h').textContent = tj_update_24h;
    });
</script>
<style>
    /* 响应式样式(小屏幕设备) */
    @media screen and (max-width: 768px) {
        /* 蚂蚁AI主体布局 */
        .ant-ai-body {
            flex-wrap: wrap;
        }

        /* 蚂蚁AI图片与主体间距 */
        .ant-ai-img .ant-ai-body {
            margin-left: 15px;
        }

        /* 底部图片在移动端隐藏 */
        #bottom-img {
            display: none;
        }
	#poemContainer{
            display: none;
        }
    }
</style>

zibll/header.php

<!--首页检测更新 -->
<script type="text/javascript">
<?php
// 获取所有文章总数
$count_posts = wp_count_posts();
$published_posts = $count_posts->publish;

// 获取要排除的分类ID列表
$excluded_category_ids = array(4, 5, ); // 多个分类ID

// 获取这些分类的文章数量
$args = array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'category__in' => $excluded_category_ids,
    'fields' => 'ids',
    'posts_per_page' => -1
);
$excluded_posts = new WP_Query($args);
$excluded_count = count($excluded_posts->posts);

// 计算实际要显示的文章总数
$adjusted_post_count = $published_posts - $excluded_count;

echo "var tj_rzzs=" . json_encode($adjusted_post_count);
?>
</script>

<script type="text/javascript">
<?php
/*
 * 获取今日更新数量
 */
function nd_get_24h_update_count() {
    global $wpdb;
    $today = date('Y-m-d', current_time('timestamp'));
    $tomorrow = date('Y-m-d', strtotime('+1 day', current_time('timestamp')));
    
    $query = "
        SELECT COUNT(*) 
        FROM $wpdb->posts
        WHERE post_status = 'publish'
        AND post_modified >= '$today'
        AND post_modified < '$tomorrow'
    ";
    
    $update_count = $wpdb->get_var($query);
    return $update_count;
}
$update_24h = nd_get_24h_update_count();
echo "var tj_update_24h=" . json_encode($update_24h);
?>
</script>
42、文章页底部添加【感谢您的来访,获取更多精彩文章请收藏本站+图片。】

网站全局变灰代码如下:

body > .header,
body > .container,
body > .footer
{
    -webkit-filter: grayscale(100%);
            filter: grayscale(100%);
}

仅首页变灰代码如下:

html .home>.header,
html .home>.container,
html .home>.footer
{
    -webkit-filter: grayscale(100%);
            filter: grayscale(100%);
}

1 2 3 4 5

© 版权声明
THE END
如果喜欢,可以【点赞】【分享】【收藏】
点赞0赞赏 分享
相关推荐
评论 共32条

请登录后发表评论