普通视图

发现新文章,点击刷新页面。
昨天以前首页
  • ✇新锐博客
  • 子比主题文章归档页面美化版莫忘
    前言 因为自己喜欢倒腾,所以从Corenext换成了子比,但不代表Corenext不好,Corenext主题绝对是做博客的首选。 我换成子比是为了倒腾一些小玩意,今天就给大家带来自己弄的一个美化版的文章归档页面 展示 教程 在子比主题的pages目录下创建一个新的php,名字随便命名,然后将如下代码放入进去 <?php /** * Template name: 新锐-文章归档 * Description: 文章归档页面,包含统计数据和文章列表 */ // 获取分类统计信息并缓存 function get_category_statistics() { return get_cached_data('category_stats', function() { $categories = get_categories(['hide_empty' => false]); $data = []; foreach ($categories as $category) {
     

子比主题文章归档页面美化版

作者 莫忘
2025年3月15日 19:25

前言

因为自己喜欢倒腾,所以从Corenext换成了子比,但不代表Corenext不好,Corenext主题绝对是做博客的首选。

我换成子比是为了倒腾一些小玩意,今天就给大家带来自己弄的一个美化版的文章归档页面

展示

图片[1]-新锐博客
图片[2]-新锐博客

教程

在子比主题的pages目录下创建一个新的php,名字随便命名,然后将如下代码放入进去

<?php
/**
 * Template name: 新锐-文章归档
 * Description: 文章归档页面,包含统计数据和文章列表
 */

// 获取分类统计信息并缓存
function get_category_statistics() {
    return get_cached_data('category_stats', function() {
        $categories = get_categories(['hide_empty' => false]);
        $data = [];
        foreach ($categories as $category) {
            $data[] = ['value' => $category->count, 'name' => $category->name];
        }
        return json_encode($data);
    });
}

// 获取最近一年每月的文章数量并缓存
function get_monthly_post_data() {
    return get_cached_data('monthly_post_data', function() {
        global $wpdb;
        $query = "
            SELECT DATE_FORMAT(post_date, '%Y-%m') AS month, COUNT(*) AS count
            FROM {$wpdb->posts}
            WHERE post_type = 'post' AND post_status = 'publish'
              AND post_date >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR)
            GROUP BY month
            ORDER BY month ASC
        ";
        $results = $wpdb->get_results($query, ARRAY_A);

        $monthly_data = [];
        foreach ($results as $result) {
            $monthly_data[] = [
                'month' => $result['month'],
                'count' => $result['count']
            ];
        }
        return json_encode($monthly_data);
    });
}

// 缓存处理函数
function get_cached_data($transient_key, $callback) {
    if (false === ($data = get_transient($transient_key))) {
        $data = call_user_func($callback);
        set_transient($transient_key, $data, 12 * HOUR_IN_SECONDS);
    }
    return $data;
}

// 统计小工具
function render_archives_widgets($type = 'day') {
    $icons = [
        'day' => ['icon' => 'fa fa-calendar', 'color' => 'c-blue', 'title' => '运营时间'],
        'post' => ['icon' => 'fa fa-file-text', 'color' => 'c-green', 'title' => '文章总数'],
        'comment' => ['icon' => 'fa fa-comments', 'color' => 'c-purple', 'title' => '评论总数'],
        'user' => ['icon' => 'fa fa-users', 'color' => 'c-orange', 'title' => '注册用户']
    ];

    switch ($type) {
        case 'day':
            $first_post = get_posts(['numberposts' => 1, 'order' => 'ASC']);
            $start_time = !empty($first_post) ? strtotime($first_post[0]->post_date) : time();
            $statistic = round((time() - $start_time) / DAY_IN_SECONDS) . ' 天';
            break;
        case 'post':
            $statistic = wp_count_posts()->publish;
            break;
        case 'comment':
            $statistic = get_comment_count()['total_comments'];
            break;
        case 'user':
            $statistic = count_users()['total_users'];
            break;
        default: return;
    }

    echo '<div class="stats-widget">';
    echo '<div class="stats-header">'.$icons[$type]['title'].'</div>';
    echo '<div class="stats-content">';
    echo '<div class="stats-icon"><i class="'.$icons[$type]['icon'].' '.$icons[$type]['color'].'"></i></div>';
    echo '<div class="stats-value">'.$statistic.'</div>';
    echo '</div></div>';
}

// 注册脚本
function grace_archives_scripts() {
  
    wp_enqueue_script('echarts', 'https://cdn.jsdmirror.com/npm/echarts@5.4.0/dist/echarts.min.js', [], null, true);
     wp_enqueue_script('archives-script', get_template_directory_uri().'/js/archives.js', ['echarts', 'jquery'], null, true);
    
    // 将数据传递给 JavaScript
    wp_localize_script('archives-script', 'graceData', [
        'postData' => json_decode(get_category_statistics()),
        'monthlyPostData' => json_decode(get_monthly_post_data()),
        'ajaxUrl' => admin_url('admin-ajax.php')
    ]);
}
add_action('wp_enqueue_scripts', 'grace_archives_scripts');

// AJAX 处理翻页请求
function load_more_posts() {
    $paged = isset($_POST['page']) ? intval($_POST['page']) : 1;
    $posts_per_page = 20;

    $query = new WP_Query([
        'posts_per_page' => $posts_per_page,
        'paged' => $paged,
        'orderby' => 'post_date',
        'order' => 'DESC',
        'post_status' => 'publish'
    ]);

    if ($query->have_posts()) :
        $organized = [];
        while ($query->have_posts()) : $query->the_post();
            $year = get_the_time('Y');
            $month = get_the_time('m');
            $organized[$year][$month][] = $post;
        endwhile;

        ob_start();
        foreach ($organized as $year => $months) : ?>
            <div class="archive-year">
                <h2 class="year-title"><?php echo $year; ?></h2>
                <?php foreach ($months as $month => $posts) : ?>
                    <div class="archive-month">
                        <h3 class="month-title"><?php echo date('n月', mktime(0, 0, 0, $month, 1)); ?></h3>
                        <ul class="post-list">
                            <?php foreach ($posts as $post) : setup_postdata($post); ?>
                                <li>
                                    <time><?php the_time('m-d'); ?></time>
                                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                                        <?php the_title(); ?>
                                        <?php if (get_comments_number()) : ?>
                                            <span class="comment-count">(<?php echo get_comments_number(); ?>)</span>
                                        <?php endif; ?>
                                    </a>
                                </li>
                            <?php endforeach; ?>
                        </ul>
                    </div>
                <?php endforeach; ?>
            </div>
        <?php endforeach;

        // 生成新的分页链接
        $pagination = paginate_links([
            'total' => $query->max_num_pages,
            'current' => $paged,
            'prev_next' => true,
            'prev_text' => __('« 上一页'),
            'next_text' => __('下一页 »'),
            'echo' => false
        ]);

        $output = ob_get_clean();
        wp_send_json_success([
            'data' => $output,
            'pagination' => $pagination
        ]);
    else :
        wp_send_json_error('No more posts');
    endif;
    wp_reset_postdata();
    wp_die();
}
add_action('wp_ajax_load_more_posts', 'load_more_posts');
add_action('wp_ajax_nopriv_load_more_posts', 'load_more_posts');

get_header();
?>

<main class="grace-archives">
    <div class="archive-container">
        <div class="archive-main">
            <article class="archive-article">
                <header class="archive-header">
                    <h1><?php the_title(); ?></h1>
                    <!-- 统计小工具 -->
                    <div class="stats-grid">
                        <?php 
                        render_archives_widgets('day');
                        render_archives_widgets('post');
                        render_archives_widgets('comment');
                        render_archives_widgets('user');
                        ?>
                    </div>
                </header>
                
                <!-- 图表区域 -->
                <div class="charts-container">
                    <div class="chart-box" id="postChart"></div>
                    <div class="chart-box" id="monthlyPostChart"></div>
                </div>

                <!-- 文章列表 -->
                <div class="archives-list">
                    <?php
                    // 获取当前页码
                    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    $posts_per_page = 20;
                    
                    $query = new WP_Query([
                        'posts_per_page' => $posts_per_page,
                        'paged' => $paged,
                        'orderby' => 'post_date',
                        'order' => 'DESC',
                        'post_status' => 'publish'
                    ]);

                    if ($query->have_posts()) :
                        $organized = [];
                        while ($query->have_posts()) : $query->the_post();
                            $year = get_the_time('Y');
                            $month = get_the_time('m');
                            $organized[$year][$month][] = $post;
                        endwhile;

                        foreach ($organized as $year => $months) : ?>
                            <div class="archive-year">
                                <h2 class="year-title"><?php echo $year; ?></h2>
                                <?php foreach ($months as $month => $posts) : ?>
                                    <div class="archive-month">
                                        <h3 class="month-title"><?php echo date('n月', mktime(0, 0, 0, $month, 1)); ?></h3>
                                        <ul class="post-list">
                                            <?php foreach ($posts as $post) : setup_postdata($post); ?>
                                                <li>
                                                    <time><?php the_time('m-d'); ?></time>
                                                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                                                        <?php the_title(); ?>
                                                        <?php if (get_comments_number()) : ?>
                                                            <span class="comment-count">(<?php echo get_comments_number(); ?>)</span>
                                                        <?php endif; ?>
                                                    </a>
                                                </li>
                                            <?php endforeach; ?>
                                        </ul>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        <?php endforeach; 
                    else :
                        echo '<p>暂无文章</p>';
                    endif;
                    wp_reset_postdata();
                    ?>
                </div>

                <!-- 传统分页 -->
<div class="archive-pagination">
    <?php
    echo paginate_links([
        'total'     => $query->max_num_pages,
        'current'   => $paged,
        'prev_next' => true,
        'prev_text' => __('« 上一页'),
        'next_text' => __('下一页 »'),
        'type'      => 'plain', // 修改这里
        'mid_size'  => 2 // 控制显示页码数量
    ]);
    ?>
</div>
            </article>
        </div>
    </div>
</main>


<script>
// 仅保留图表初始化代码
jQuery(document).ready(function($) {
    // 初始化 ECharts 图表
    const postChart = echarts.init(document.getElementById('postChart'));
    const monthlyPostChart = echarts.init(document.getElementById('monthlyPostChart'));

    postChart.setOption({
        title: { text: '文章分类分布' },
        tooltip: { trigger: 'item' },
        series: [{
            type: 'pie',
            data: graceData.postData
        }]
    });

    monthlyPostChart.setOption({
        title: { text: '每月发文数量' },
        tooltip: { trigger: 'axis' },
        xAxis: {
            type: 'category',
            data: graceData.monthlyPostData.map(item => item.month)
        },
        yAxis: { type: 'value' },
        series: [{
            type: 'line',
            data: graceData.monthlyPostData.map(item => item.count)
        }]
    });
});
</script>

<style>
.grace-archives {
    padding: 2rem 20px;
    background: #f8f9fa;
    min-height: 100vh;
}
/* 分页容器 */
.archive-pagination {
    margin-top: 3rem;
    text-align: center;
}

/* 分页链接基础样式 */
.archive-pagination a, 
.archive-pagination span {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s;
}

/* 当前页样式 */
.archive-pagination span.current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 悬停效果 */
.archive-pagination a:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .archive-pagination a, 
    .archive-pagination span {
        padding: 6px 12px;
        margin: 2px;
        font-size: 14px;
    }
}
.archive-container {
    max-width: 1400px;
    margin: 0 auto;
}

.archive-main {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.archive-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1.5rem;
}

.archive-header h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin: 0 0 1.5rem;
}

/* 统计小工具 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.stats-widget {
    background: #ffffff;
    border: 1px solid #eaeaea;
    padding: 1.5rem;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stats-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.stats-header {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.stats-content {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.stats-icon i {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
}

/* 颜色定义 */
.c-blue { background: #e3f2fd; color: #2196f3; }
.c-green { background: #e8f5e9; color: #4caf50; }
.c-purple { background: #f3e5f5; color: #9c27b0; }
.c-orange { background: #fff3e0; color: #ff9800; }

/* 图表容器 */
.charts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 3rem 0;
}

.chart-box {
    height: 400px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1rem;
}

/* 文章列表 */
.archives-list {
    margin-top: 2rem;
}

.archive-year {
    margin-bottom: 3rem;
    background: #fafafa;
    border-radius: 8px;
    padding: 1.5rem;
}

.year-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0 0 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #eee;
}

.archive-month {
    margin-bottom: 2rem;
    background: #fff;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.month-title {
    font-size: 1.4rem;
    color: #34495e;
    margin: 0 0 1rem;
    padding-left: 0.5rem;
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list li {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: background 0.3s;
}

.post-list li:hover {
    background: #f8f9fa;
}

.post-list time {
    color: #7f8c8d;
    min-width: 70px;
    font-family: monospace;
    font-size: 0.95rem;
}

.post-list a {
    color: #2c3e50;
    transition: color 0.3s;
    flex-grow: 1;
    text-decoration: none;
    font-weight: 500;
}

.post-list a:hover {
    color: #3498db;
}

.comment-count {
    color: #95a5a6;
    font-size: 0.85em;
    margin-left: 0.8rem;
    font-weight: normal;
}

/* 分页样式 */
.archive-pagination {
    margin-top: 3rem;
    text-align: center;
    padding: 1.5rem 0;
}

.archive-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s;
}

.archive-pagination .page-numbers.current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.archive-pagination .page-numbers:hover:not(.current) {
    background: #f8f9fa;
    border-color: #3498db;
}

/* 加载提示 */
.loading {
    text-align: center;
    padding: 1.5rem;
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
    .chart-box {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stats-value {
        font-size: 1.6rem;
    }
    
    .archive-main {
        padding: 1.5rem;
    }
    
    .year-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-content {
        gap: 1rem;
    }
    
    .archive-pagination .page-numbers {
        padding: 6px 12px;
        margin: 3px;
    }
    
    .post-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }
    
}
</style>
<?php get_footer(); ?>

再到子比主题根目录里的JS文件夹里创建一个archives.js的文件,然后将如下代码放进去

// archives.js 完整代码

document.addEventListener('DOMContentLoaded', function() {
    
     const chartContainers = [
        'postChart', 
        'monthlyPostChart'
    ];

    chartContainers.forEach(id => {
        const el = document.getElementById(id);
        if (!el) {
            console.warn(`图表容器 #${id} 未找到`);
            return;
        }
        
        try {
            // 初始化图表代码...
        } catch (error) {
            console.error(`初始化图表 ${id} 失败:`, error);
        }
    });
    // 获取图表容器
    const postChartEl = document.getElementById('postChart');
    const monthlyChartEl = document.getElementById('monthlyPostChart');
    
    // 检查元素是否存在
    if (!postChartEl || !monthlyChartEl) {
        console.warn('图表容器未找到,请检查元素ID是否正确');
        return;
    }

    // 初始化图表实例
    const postChart = echarts.init(postChartEl);
    const monthlyPostChart = echarts.init(monthlyChartEl);

    // 配置分类分布饼图
    postChart.setOption({
        title: { text: '文章分类分布', left: 'center' },
        tooltip: { trigger: 'item' },
        series: [{
            type: 'pie',
            radius: '55%',
            data: graceData.postData,
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }]
    });

    // 配置月度趋势折线图
    monthlyPostChart.setOption({
        title: { text: '月度发文趋势', left: 'center' },
        tooltip: { trigger: 'axis' },
        xAxis: {
            type: 'category',
            data: graceData.monthlyPostData.map(item => item.month),
            axisLabel: { rotate: 45 }
        },
        yAxis: { type: 'value' },
        series: [{
            type: 'line',
            smooth: true,
            data: graceData.monthlyPostData.map(item => item.count),
            areaStyle: { color: 'rgba(52, 152, 219, 0.2)' }
        }],
        grid: { containLabel: true }
    });

    // 窗口大小变化时自适应
    window.addEventListener('resize', function() {
        postChart.resize();
        monthlyPostChart.resize();
    });
});

最后再到页面中选择新锐-文章归档模版即可

  • ✇新锐博客
  • 给你的网站添加一个Ctrl+D收藏引导莫忘
    前言 现在很多网站都有以下截图的Ctrl+D收藏的引导图片,这次就教大家如何用代码实现。 截图 教程 在 wp 后台打开外观 - 小工具,然后将下面代码用自定义 HTML 添加至底部小工具即可,如果是想在每一个页面都加上这个,就在主题根目录下的footer.php 文件里的末尾添加以下代码即可。 默认是黑色的底色,如果不喜欢黑色底色可以替换 #18222b 颜色代码 文本内容也可自己根据自己的需求来适当修改 代码 <style type="text/css"> #go-fav { width: 100%; height: 60px; line-height: 60px; text-align: center; background: #18222b; font-size: 14px; font-weight: 400; color: rgba(255, 255, 255, 1) } #go-fav span { padding: 5px 10px; background: rgba(255, 197, 0, 1); border-radius: 5px; colo
     

给你的网站添加一个Ctrl+D收藏引导

作者 莫忘
2024年2月27日 21:35

前言

现在很多网站都有以下截图的Ctrl+D收藏的引导图片,这次就教大家如何用代码实现。

截图

图片[1]-新锐博客

教程

在 wp 后台打开外观 - 小工具,然后将下面代码用自定义 HTML 添加至底部小工具即可,如果是想在每一个页面都加上这个,就在主题根目录下的footer.php 文件里的末尾添加以下代码即可。

  • 默认是黑色的底色,如果不喜欢黑色底色可以替换 #18222b 颜色代码
  • 文本内容也可自己根据自己的需求来适当修改

代码

<style type="text/css">
#go-fav {
width: 100%;
height: 60px;
line-height: 60px;
text-align: center;
background: #18222b;
font-size: 14px;
font-weight: 400;
color: rgba(255, 255, 255, 1)
}
 
#go-fav span {
padding: 5px 10px;
background: rgba(255, 197, 0, 1);
border-radius: 5px;
color: #202020;
margin: 0 5px
}
 
#go-fav a {color: #aeaeae}
 
#go-fav a:hover {color: var(--focus-color)
}
</style>
<div id="go-fav"> 按 <span>Ctrl</span>+<span>D</span> 收藏本站 或 <a class="find-more" href="/" rel="nofollow noopener" target="_blank"> 发现更多 </a></div>
  • ✇新锐博客
  • 网站侧边栏添加公众号翻滚模块莫忘
    前言 有些网站都有很好看的翻滚公众号图片,刚好看到六月是只猫有相关的教程,就抄一下,以下是教程 教程 首先在侧边栏自定义html添加如下代码 <div class="textwidget custom-html-widget"><div class="qqg-card-widget" id="qqg-card-wechat" onclick="window.open('https://www.xrbk.cn');"> <div id="qqg-flip-wrapper"> <div id="qqg-flip-content"> <div class="qqg-face"></div> <div class="qqg-back qqg-face"></div> </div></div></div></div> CoreNext主题添加如下CSS代码到子主题中 /* wxgzh-card-shad
     

网站侧边栏添加公众号翻滚模块

作者 莫忘
2024年2月20日 00:34

前言

有些网站都有很好看的翻滚公众号图片,刚好看到六月是只猫有相关的教程,就抄一下,以下是教程

教程

首先在侧边栏自定义html添加如下代码

<div class="textwidget custom-html-widget"><div class="qqg-card-widget" id="qqg-card-wechat" onclick="window.open('https://www.xrbk.cn');">
    <div id="qqg-flip-wrapper">
      <div id="qqg-flip-content">
      <div class="qqg-face"></div>
      <div class="qqg-back qqg-face"></div>
    </div></div></div></div>

CoreNext主题添加如下CSS代码到子主题中

/* wxgzh-card-shadow */
 .wx-card-widget {
  box-shadow: 0 8px 16px -4px #2c2d300c;
  background: #fff;
  border: 1px solid #e3e8f7;
  transition: 0.3s;
  border-radius: 12px;
  transition: 0.3s;
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
}

/* wxgzh-fanzhuan */
#wx-flip-wrapper {
    position: relative;
    width: 235px;
    height: 110px;
    z-index: 1;
}

#wx-flip-content {
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: cubic-bezier(0, 0, 0, 1.29) 0.3s;
}

#wx-flip-wrapper:hover #wx-flip-content {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.wx-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: url(/wx_face.png) center center no-repeat;
    background-size: 100%;
}

.wx-back.wx-face {
    display: block;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    box-sizing: border-box;
    background: url(wx_code.png) center center no-repeat;
    background-size: 100%;
}

/* wxgzh-background */
.wx-card-widget#wx-card-wechat::before {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: url(gzh_cover.png) center center no-repeat;
    content: '';
}

.wx-card-widget#wx-card-wechat {
    background: #57bd6a;
    display: flex;
    justify-content: center;
    align-content: center;
    padding: 0;
    cursor: pointer;
    border: none;
    height: 110px;
}

.wx-card-widget#wx-card-wechat img {
    max-height: 110px;
    object-fit: cover;
}

/* QQG-card-shadow */
 .qqg-card-widget {
  box-shadow: 0 8px 16px -4px #2c2d300c;
  background: #fff;
  border: 1px solid #e3e8f7;
  transition: 0.3s;
  border-radius: 12px;
  transition: 0.3s;
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
}

/* QQG-fanzhuan */
#qqg-flip-wrapper {
    position: relative;
    width: 235px;
    height: 110px;
    z-index: 1;
}

#qqg-flip-content {
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: cubic-bezier(0, 0, 0, 1.29) 0.3s;
}

#qqg-flip-wrapper:hover #qqg-flip-content {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.qqg-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: url(/qqg_face.png) center center no-repeat;
    background-size: 100%;
}

.qqg-back.qqg-face {
    display: block;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    box-sizing: border-box;
    background: url(/qqg_code.png) center center no-repeat;
    background-size: 100%;
}

/* QQG-background */
.qqg-card-widget#qqg-card-wechat::before {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: url(/qq_cover.png) center center no-repeat;
    content: '';
}

.qqg-card-widget#qqg-card-wechat {
    background: #00aef8;
    display: flex;
    justify-content: center;
    align-content: center;
    padding: 0;
    cursor: pointer;
    border: none;
    height: 110px;
}

.qqg-card-widget#qqg-card-wechat img {
    max-height: 110px;
    object-fit: cover;
}

下载附件图片素材上传到服务器,并修改css里面的url就行了,F5刷新就可以看到效果了。

网站翻转素材
  • ✇新锐博客
  • WordPress插件-文章页字数,阅读时间,更新时间和浏览量的提示莫忘
    前言 相信很多人都和我一样想在文章的顶部添加文章阅读时间和文字还有更新时间,但是苦于网上的各种教程都需要修改主题内的PHP文件,导致一旦主题更新就需要重新覆盖就很麻烦。所以本人费了点心思搞了个插件,直接一键安装启动即可。 界面截图 更新历程 1.0  更新时间:2024年1月11日 1.添加了文章顶部显示文章字数 2.添加了文章顶部显示阅读大概时间 3.添加了文章顶部显示文章更新时间及提醒 2.0  更新时间:2024年1月12日  1.添加了文章顶部显示浏览量,需要配合WP-PostView插件一起使用 下载地址 WP-PostViews下载 read-time-and-word-count下载
     

WordPress插件-文章页字数,阅读时间,更新时间和浏览量的提示

作者 莫忘
2024年1月12日 00:14

前言

相信很多人都和我一样想在文章的顶部添加文章阅读时间和文字还有更新时间,但是苦于网上的各种教程都需要修改主题内的PHP文件,导致一旦主题更新就需要重新覆盖就很麻烦。
所以本人费了点心思搞了个插件,直接一键安装启动即可。

界面截图

图片[1]-新锐博客

更新历程

1.0  更新时间:2024年1月11日

1.添加了文章顶部显示文章字数

2.添加了文章顶部显示阅读大概时间

3.添加了文章顶部显示文章更新时间及提醒

2.0  更新时间:2024年1月12日

 1.添加了文章顶部显示浏览量,需要配合WP-PostView插件一起使用

下载地址

WP-PostViews
read-time-and-word-count

  • ✇新锐博客
  • CoreNext_Beautiful - CoreNext主题的美化插件莫忘
    前言 之前就讲过关于CoreNext主题美化,但是对于很多人来说有点麻烦,所以这次搞了个插件。 功能 技术有限,只能更新四个美化 1.彩虹滚动条 2.首页文章鼠标停留悬浮 3.文章页图片鼠标停留悬浮 4.友链模块美化 界面截图 下载地址 CoreNext_Beautiful下载
     

CoreNext_Beautiful - CoreNext主题的美化插件

作者 莫忘
2024年1月5日 21:53

前言

之前就讲过关于CoreNext主题美化,但是对于很多人来说有点麻烦,所以这次搞了个插件。

功能

技术有限,只能更新四个美化

1.彩虹滚动条

2.首页文章鼠标停留悬浮

3.文章页图片鼠标停留悬浮

4.友链模块美化

界面截图

图片[1]-新锐博客

下载地址

CoreNext_Beautiful
  • ✇新锐博客
  • CoreNext主题美化合集莫忘
    前言 本次美化教程部分来源于CorePress主题美化合集,再加上本人的修改而成。 本章内容不定时更新,有好的美化教程第一时间分享出来,记得经常光顾本站! 本章内容只适合CoreNext主题,其他主题暂未测试,如有问题自行调整。 教程 所有Css代码放到子主题文件夹中的Css文件夹内的main.css内即可。 更新时间 最新更新时间:2024年6月19日23:06:21 代码 申请友链模块 css代码如下: /* 友链申请按钮美化 */ .application-url { padding: 5px 10px; color: white !important; text-decoration: none; border-radius: 50px; background: linear-gradient(to right, #fd0808, #df05ed); background-size: 200% auto; animation: flowingGradient 3s ease-in-out inf
     

CoreNext主题美化合集

作者 莫忘
2024年1月4日 13:22

前言

  • 本次美化教程部分来源于CorePress主题美化合集,再加上本人的修改而成。
  • 本章内容不定时更新,有好的美化教程第一时间分享出来,记得经常光顾本站!
  • 本章内容只适合CoreNext主题,其他主题暂未测试,如有问题自行调整。

教程

所有Css代码放到子主题文件夹中的Css文件夹内的main.css内即可。

更新时间

最新更新时间:2024年6月19日23:06:21

代码

申请友链模块

css代码如下:

/* 友链申请按钮美化 */
.application-url {
    padding: 5px 10px;
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    background: linear-gradient(to right, #fd0808, #df05ed);
    background-size: 200% auto;
    animation: flowingGradient 3s ease-in-out infinite;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    filter: brightness(130%);
}
.application-url:hover {
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -o-transform: scale(1.1);
    -ms-transform: scale(1.1);
}
@keyframes flowingGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.application-url .friends-title > div  {
    line-height: 32px;
}
评论输入框添加背景图

css代码如下:

/*评论背景图*/
textarea.comment-textarea[data-v-1ef8f4cc] {
    background-color:transparent;background:linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)),url(/api/img/comment.png) right 10px bottom 10px no-repeat;
    -moz-transition:ease-in-out 0.45s;
    -webkit-transition:ease-in-out 0.45s;
    -o-transition:ease-in-out 0.45s;
    -ms-transition:ease-in-out 0.45s;
    transition:ease-in-out 0.45s;
}
textarea.comment-textarea[data-v-1ef8f4cc]:focus {
    background-position-y:789px;
    -moz-transition:ease-in-out 0.45s;
    -webkit-transition:ease-in-out 0.45s;
    -o-transition:ease-in-out 0.45s;
    -ms-transition:ease-in-out 0.45s;
    transition:ease-in-out 0.45s;
}

请将其中的/wp-content/uploads/2023/03/comment.png 替换为自己的图片地址

效果如下:

图片[1]-新锐博客

文章页图片悬浮

css代码如下:

图片具体文字太近,加了一个 margin 属性,不需要的可以去掉

/*文章图片悬浮效果*/
.core-next-img {
    transition: All 0.4s ease-in-out;
    -webkit-transition: All 0.4s ease-in-out;
    -moz-transition: All 0.4s ease-in-out;
    -o-transition: All 0.4s ease-in-out;
    margin: 10px 0;
}
.core-next-img:hover {
    transform: translate(0, -10px);
    -webkit-transform: translate(0, -10px);
    -moz-transform: translate(0, -10px);
    -o-transform: translate(0, -10px);
    -ms-transform: translate(0, -10px);
    box-shadow:5px 5px 10px gray;   
} 
添加彩色滚动条

css代码如下:

/**彩色滚动条*/
::-webkit-scrollbar {
    width: 8px;  
    height: 1px;
}
::-webkit-scrollbar-thumb {
    background-color: #12b7f5;
    background-image: -webkit-linear-gradient(45deg, rgba(255, 93, 143, 1) 25%, transparent 25%, transparent 50%, rgba(255, 93, 143, 1) 50%, rgba(255, 93, 143, 1) 75%, transparent 75%, transparent);
}
::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: #f6f6f6;
}
首页文章悬浮效果

css代码如下:

.post-list .post-item:hover {
    opacity: 1;
    z-index: 99;
    border-radius: 20px;
    transform: translateY(-5px);
    box-shadow: 0 3px 20px rgb(0 0 0 / 25%);
    animation: index-link-active 1s cubic-bezier(0.315, 0.605, 0.375, 0.925) forwards;
}
.post-list .post-item:hover .post-item__cover {
  transform: translateY(-100%);
}
.post-list .post-item__cover {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  transform: translateY(0);
}
.post-list .post-item__title {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}
底部菜单美化

本代码来源于诺言博客

css代码如下:

/*CSS 网站底部自定义按钮美化开始*/
:root{--theme-color:#f04494;
--focus-shadow-color:rgba(240,68,148,.4);
--mian-max-width:1200px;}.github-badge {
    display: inline-block;
    border-radius: 4px;    text-shadow: none;    font-size: 12px;    color: #fff;    line-height: 15px;    margin-bottom: 5px;}.badge-subject {
    display: inline-block;    background-color: #4d4d4d;    padding: 4px 4px 4px 6px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;}.github-badge .bg-blue {
    background-color: #007ec6;}.github-badge .bg-brightgreen {
    background-color: #4dc820;}.github-badge .bg-blueviolet {
    background-color: #8833d7;}.github-badge .badge-value {
    display: inline-block;    padding: 4px 6px 4px 4px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;}.github-badge .bg-orange {
    background-color: orange;}.github-badge .bg-red {
    background-color: red;}
    /*CSS 网站底部自定义按钮美化结束*/
    

再进入小工具的底部左侧添加自定义Html,代码如下

<div class="github-badge">
<span class="badge-subject bg-blue"><a style="color:#fff" href="#" target="_blank">友链申请</a>
</span>
<span class="badge-subject bg-blueviolet"><a style="color:#fff" href="#" target="_blank">网站地图</a>
</span>
<span class="badge-subject bg-green"><a style="color:#fff" href="#" target="_blank">留言建议</a>
</span>
<span class="badge-subject bg-orange"><a style="color:#fff" href="#" target="_blank">免责申明</a>
</span>
</div>

将其中的#换成自己的链接即可

底部黑暗明亮模式切换

首先找到主题文件夹下的/static/css/dark.css 添加如下代码

.core-footer{background: #22292d !important;color: #b3c0ce !important;}

然后添加CSS代码

css代码如下:

/** 修改底部颜色 */
.core-footer {
   background: #fff;
   color: #999;
   box-shadow: 0 0.5px 0.5px 1px rgb(0 0 0 / 10%);
    padding: 20px 30px 30px 30px;
}
.core-footer a {
   color: unset!important;;
}
.footer-right {
   margin-bottom: unset!important;;
}
.core-footer a:hover {
    color:var(--MaincolorHover) !important;
}
文章底部添加时间和时效性

css代码如下

/**文章添加时间和时效性*/
#comment_addface { 
    position: relative 
} 
.conment-face-plane { 
    position: absolute; 
    transition: .15s; 
    box-shadow: 0 5px 10px rgba(0, 0, 0, .2); 
    border: 1px solid rgba(0, 0, 0, .2); 
    border-radius: 6px; 
    top: 100%; 
    padding: 10px; 
    background: #fff; 
    max-width: 300px; 
    z-index: 9999; 
    opacity: 1; 
    visibility: hidden 
} 
.popover-btn-face { 
    margin-top: 10px 
} 
.popover-btn { 
    border-radius: 4px; 
    display: inline-block; 
    transition: .15s; 
    vertical-align: middle; 
    padding: .3em .5em; 
    text-align: center; 
    line-height: 1.44; 
    border: none; 
    outline: none; 
    cursor: pointer 
}

再到子主题的template文件夹内的single.php添加如下代码

<div class="c-alert c-alert-error">本文最后更新于<code><?php echo the_time('Y-m-j');
?></code>部分内容具有时效性,如有失效,请留言</div>
LOGO扫光

代码如下

.home-img {
    position:relative;
    float:left;
    margin-right:10px;
    padding:5px 0;
    overflow:hidden;
}
.home-img  a:before {
    content:"";
    position:absolute;
    left:-665px;
    top:-460px;
    width:200px;
    height:15px;
    background-color:rgba(255,255,255,.5);
    -webkit-transform:rotate(-45deg);
    -moz-transform:rotate(-45deg);
    -ms-transform:rotate(-45deg);
    -o-transform:rotate(-45deg);
    transform:rotate(-45deg);
    -webkit-animation:searchLights 1s ease-in 1s infinite;
    -o-animation:searchLights 1s ease-in 1s infinite;
    animation:searchLights 2s ease-in 2s infinite;
}
@-webkit-keyframes searchLights {
    0% { left:-100px; top:0; }
    to { left:120px; top:100px; }
}
@-o-keyframes searchLights {
    0% { left:-100px; top:0; }
    to { left:120px; top:100px; }
}
@-moz-keyframes searchLights {
    0% { left:-100px; top:0; }
    to { left:120px; top:100px; }
}
@keyframes searchLights {
    0% { left:-100px; top:0; }
    to { left:120px; top:100px; }
}
去除侧边栏站长工具中的数据统计

css代码如下

.webmaster-widget .webmaster-site-info{
    display: none;
}
导航栏添加背景图和透明效果

首先下载背景图:

图片[2]-新锐博客

css代码如下:

your img api 替换为你的图片链接

/**  导航栏添加背景图和透明效果  */
header {
    background-color: rgba(255, 255, 255, 0.96);
    background-image: url(your img api);
    background-position: center right;
    background-size: auto 100%;
    box-shadow: 0px 5px 40px 0px rgba(17,58,93,0.1);
}
.menu-header-plane > ul {
   background-color: rgba(255, 255, 255, 0.96);
    background: unset;
}
首页文章添加间距

css代码如下

.post-item {
  margin-bottom: 20px;
}
实时监测页面是否离开并自动更改标题

将如下代码添加到后台主题设置-插入代码 - 页头代码

<script>
document.addEventListener('visibilitychange', function () {
if (document.visibilityState == 'hidden') {
    normal_title = document.title;
    document.title = 'w(゚Д゚)w 宝~请不要离开!';
} else document.title = normal_title;
});
</script>

其中的w(゚Д゚)w 宝~请不要离开!normal_title 分别为离开时和返回时显示的标题,可以根据自己的喜好修改

底部ICP备案信息居中

有不少地区或者服务商要求备案信息放在底部居中

将CSS代码放入子主题的CSS文件中

.core-footer {
  position: relative;
}
.icp-warp {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
侧边栏添加欢迎词

如下图效果

图片[3]-新锐博客

侧边栏添加如下自定义html代码

<div id="scroll-broadcast">
    <div id="container-box-1">
        <div class="container-box-1-1">每天来逛逛我的博客,会让你</div>
        <div id="flip-box-1">
            <div><div class="flip-box-1-1">生活也美好了!</div></div>
            <div><div class="flip-box-1-2">心情也舒畅了!</div></div>
            <div><div class="flip-box-1-3">走路也有劲了!</div></div>
            <div><div class="flip-box-1-4">腿也不痛了!</div></div>
            <div><div class="flip-box-1-5">腰也不酸了!</div></div>
            <div><div class="flip-box-1-6">工作也轻松了!</div></div>
        </div>
        <div class="container-box-1-2">你好我也好,不要忘记哦!</div>
    </div>
</div>
<style type="text/css">
    #scroll-broadcast {margin: -10px;}
    #container-box-1{color: #4c5864;font-weight: bold; border-radius: var(--border-hd);text-transform:uppercase;width:100%;font-size:16px;line-height:50px;text-align:center;padding: 10px;background: linear-gradient(45deg, #C7F5FE 10%, #C7F5FE 40%, #FCC8F8 40%, #FCC8F8 60%, #EAB4F8 60%, #EAB4F8 65%, #F3F798 65%, #F3F798 90%);}
    #flip-box-1{overflow:hidden;height:50px;border-radius:99px}
    #flip-box-1 div{height:50px}
    #flip-box-1>div>div{color:#fff;display:inline-block;text-align:center;height:50px;width:100%}
    #flip-box-1 div:first-child{animation:show 8s linear infinite}
    .flip-box-1-1{background-image:linear-gradient(to right,#fa709a 0,#fee140 100%)}
    .flip-box-1-2{background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);}
    .flip-box-1-3{background-image: linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%);}
    .flip-box-1-4{background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);}
    .flip-box-1-5{background-image: linear-gradient(to right, #74ebd5 0%, #9face6 100%);}
    .flip-box-1-6{background-image: linear-gradient(to top, #9795f0 0%, #fbc8d4 100%);}
    @keyframes show{
        0%{margin-top:-300px}
        5%{margin-top:-250px}
        16.666%{margin-top:-250px}
        21.666%{margin-top:-200px}
        33.332%{margin-top:-200px}
        38.332%{margin-top:-150px}
        49.998%{margin-top:-150px}
        54.998%{margin-top:-100px}
        66.664%{margin-top:-100px}
        71.664%{margin-top:-50px}
        83.33%{margin-top:-50px}
        88.33%{margin-top:0}
        99.996%{margin-top:0}
    100%{margin-top:300px}
    }
</style>
文章版权信息

将如下代码添加到主题设置中

<fieldset style=" border: 1.5px dashed #008cff; padding: 10px; border-radius: 5px; line-height: 2em;font-weight: 700;color: var(--key-color);background-color: var(--body-bg-color);">
      <legend align="center" style=" margin-bottom: -2px;width: 30%;text-align: center; background-color: #008cff; border-radius: 999px; background-image: linear-gradient(to right, #FFCC99, #FF99CC);border: 1.5px dashed #008cff;">
        版权声明
      </legend>
      <span class="btn-info btn-xs">1</span> 本文章标题:<span style="color: #3333ff"><span style="color: #09ace2; font-size: 15px"><strong>#postname# </strong></span></span><br>
      <span class="btn-info btn-xs">2</span> 本文章地址:<font color="#09ace2">#url# </font><br>
 <span class="btn-info btn-xs">3</span> 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请发送邮件至<font color="#09ace2">xxx@qq.com</font>进行删除处理。<br>
      <span class="btn-info btn-xs">4</span> 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。<br>
            <span class="btn-info btn-xs">5</span> 如您发现本站提供资源链接失效或有违规现象,请联系我们处理。<br>
    </fieldset>
  • ✇新锐博客
  • CorePress主题美化合集莫忘
    前言 本次美化教程均来源于其他优秀站点,本人只是把它们整合到一起罢了。 本章内容不定时更新,有好的美化教程第一时间分享出来,记得经常光顾本站! 本章内容只适合Corepress主题,其他主题暂未测试,如有问题自行调整。 教程 免费版可以将下方的css填写到主题的自定义css 中,Pro版本放到子主题的style.css 中即可。 更新时间 最新更新时间:2023年4月30日22:20:58 代码 首页模仿mac样式 本代码来源于corepress主题官网:https://www.lovestu.com/corepressmac.html /** 首页模仿mac样式 */ :root { --border-hd: 10px !important; } body header { box-shadow: 0 0 20px 0 rgb(0 0 0 / 5%); } .post-list-page-plane { background-color: #fff; } body .widget-title { border-bottom: none
     

CorePress主题美化合集

作者 莫忘
2023年4月26日 21:03

前言

  • 本次美化教程均来源于其他优秀站点,本人只是把它们整合到一起罢了。
  • 本章内容不定时更新,有好的美化教程第一时间分享出来,记得经常光顾本站!
  • 本章内容只适合Corepress主题,其他主题暂未测试,如有问题自行调整。

教程

免费版可以将下方的css填写到主题的自定义css 中,Pro版本放到子主题的style.css 中即可。

更新时间

最新更新时间:2023年4月30日22:20:58

代码

首页模仿mac样式

本代码来源于corepress主题官网:https://www.lovestu.com/corepressmac.html

/** 首页模仿mac样式 */
:root {
    --border-hd: 10px !important;
}
body header {
    box-shadow: 0 0 20px 0 rgb(0 0 0 / 5%);
}
.post-list-page-plane {
    background-color: #fff;
}
body .widget-title {
    border-bottom: none;
}
.friend-links {
    overflow: hidden;
}
body .widget-title:before {
    width: 12px;
    height: 12px;
    transform: none;
    background: #fc625d;
    border-radius: 50%;
    top: 10px;
}
body .widget-title:after {
    background-color: #fdbc40;
    width: 12px;
    height: 12px;
    transform: none;
    border-radius: 50%;
    left: 20px;
    top: 10px;
}
body .widget-title {
    padding-left: 40px;
}
.widget-admin-author-contact-item-icon {
    border-bottom-left-radius:2px!important;
}

申请友链模块

本代码来源于阿蛮君博客:https://www.amjun.com/1830.html

css代码如下:

1.申请按钮美化

/* 按钮美化 */
.friend-links-apply {
    padding: 5px 10px;
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    background: linear-gradient(to right, #fd0808, #df05ed);
    background-size: 200% auto;
    animation: flowingGradient 3s ease-in-out infinite;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    filter: brightness(130%);
}
.friend-links-apply:hover {
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -o-transform: scale(1.1);
    -ms-transform: scale(1.1);
}
@keyframes flowingGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.friend-links .list-plane-title > div {
    line-height: 30px;
}
.fa-paper-plane:hover { color:red; }

2.按钮悬浮

/* 友链a标签放大效果 */
.friend-links-list a:hover {
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -o-transform: scale(1.1);
    -ms-transform: scale(1.1);
}

3.多行友链添加空隙

/** 友情链接多行时显示过于紧凑 **/
.friend-links-list {
   padding: 10px 10px 10px 15px !important;
}
.friend-links-list a {
   margin-bottom: 10px;
}

4.手机底部导航并美化(按需添加)

@media screen and (max-width: 800px) {
  .friend-links { display: block !important; }
  .friend-links .list-plane-title { padding: 0px; }
  .friend-links-list img { display: none !important; }
  .friend-links .list-plane-title > div {
      padding: 5px 0px 5px 15px;
      font-size: 16px;
      clear: both;
  }
  .list-plane-linksdescribe, .friend-links-apply{ display:none!important }
  .friend-links-list {
      padding: 10px !important;
      margin: 0 5px;
      display: block;
  }
  .friend-links-list a {
      font-size: 12px;
      margin-bottom: 5px;
      color: #262525!important;
      -webkit-tap-highlight-color: transparent;
  }
  .friend-links-item { margin-right: 0px; }
  .friend-links-item:not(:first-child):before {
      content: "";
      width: 4px;
      height: 4px;
      margin: 0 .3em;
      border-radius: 50%;
      display: inline-block;
      vertical-align: middle;
      background:#262525;
      opacity: .3;
      vertical-align: .2em;
  }
}

评论输入框添加背景图

本代码来源于阿蛮君博客:https://www.amjun.com/1686.html

/*评论背景图*/
textarea#comment {
    background-color:transparent;
    background:linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)),url(/wp-content/uploads/2023/03/comment.png) right 10px bottom 10px no-repeat;
    -moz-transition:ease-in-out 0.45s;
    -webkit-transition:ease-in-out 0.45s;
    -o-transition:ease-in-out 0.45s;
    -ms-transition:ease-in-out 0.45s;
    transition:ease-in-out 0.45s;
}
textarea#comment:focus {
    background-position-y:789px;
    -moz-transition:ease-in-out 0.45s;
    -webkit-transition:ease-in-out 0.45s;
    -o-transition:ease-in-out 0.45s;
    -ms-transition:ease-in-out 0.45s;
    transition:ease-in-out 0.45s;
}

请将其中的/wp-content/uploads/2023/03/comment.png 替换为自己的图片地址

图片[1]-新锐博客

优化上一篇下一篇样式

本代码来源于阿蛮君博客:https://www.amjun.com/1685.html

/** 上一篇下一篇优化 */
.post-turn-page-main a {
    white-space: nowrap;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

文章页图片悬浮

本代码来源于阿蛮君博客:https://www.amjun.com/1658.html

/*文章图片悬浮效果*/
.post-content-content img {
    transition: All 0.4s ease-in-out;
    -webkit-transition: All 0.4s ease-in-out;
    -moz-transition: All 0.4s ease-in-out;
    -o-transition: All 0.4s ease-in-out;
    margin: 10px 0;
}
.post-content-content img:hover {
    transform: translate(0, -10px);
    -webkit-transform: translate(0, -10px);
    -moz-transform: translate(0, -10px);
    -o-transform: translate(0, -10px);
    -ms-transform: translate(0, -10px);
    box-shadow:5px 5px 10px gray;   
}

添加彩色滚动条

本代码来源于阿蛮君博客:https://www.amjun.com/1653.html

/**彩色滚动条*/
::-webkit-scrollbar {
    width: 8px;  
    height: 1px;
}
::-webkit-scrollbar-thumb {
    background-color: #12b7f5;
    background-image: -webkit-linear-gradient(45deg, rgba(255, 93, 143, 1) 25%, transparent 25%, transparent 50%, rgba(255, 93, 143, 1) 50%, rgba(255, 93, 143, 1) 75%, transparent 75%, transparent);
}
::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: #f6f6f6;
}

文章底部彩色标签

本代码来源于技术SOLO博客:https://www.jssolo.com/note/903

/** 文章底部彩色标签 */
.post-tags{margin-bottom: 10px}
.post-tags a{
    padding: 4px 10px;
    background-color: #36a1d2;
    color: white;
    font-size: 12px;
    margin: 0 5px 5px 0;
    border-radius: 10px;
    display: inline-block
}
.post-tags a:nth-child(5n){background-color: #7d43da}
.post-tags a:nth-child(5n+1){background-color: #d74e4b}
.post-tags a:nth-child(5n+2){background-color: #dc9e3a}
.post-tags a:nth-child(5n+3){background-color: #30ce67}
.post-tags a:nth-child(5n+4){background-color: #339ecf}
.post-tags a:hover{background-color: #494949}
.tag-cloud-link:before {content: unset;}

底部菜单美化

本代码来源于阿蛮君博客:https://www.amjun.com/1860.html

/** 底部菜单美化 */
.menu-footer-list {
    display: inline-block;
    border-radius: 4px;
    font-size: 12px;
    color: #fff !important;
    line-height: 15px;
    margin-bottom: 5px;
}
.menu-footer-list .menu-item a {
    font-size: 13px;
}
.menu-footer-list .menu-item{
    display: inline-block;
    background-color: #4d4d4d;
    padding: 4px 4px 4px 6px;
    border-radius: 4px 0 0 4px;
    margin-right: 5px;
}
.menu-footer-list li:nth-child(6n+1) {background-color: #4dc820}
.menu-footer-list li:nth-child(6n+2) {background-color: #8833d7}
.menu-footer-list li:nth-child(6n+3) {background-color: orange}
.menu-footer-list li:nth-child(6n+4) {background-color: #e91515}
.menu-footer-list li:nth-child(6n+5){background-color: #007ec6}
.menu-footer-list li:nth-child(6n) {background-color: #e323c2}
#menu-footer-nav li:hover {
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
}

实时监测页面是否离开并自动更改标题
<script>
document.addEventListener('visibilitychange', function () {
    if (document.visibilityState == 'hidden') {
        normal_title = document.title;
        document.title = 'w(゚Д゚)w 宝~请不要离开!';
    } else {
        document.title = normal_title;
    }
});
</script>

添加导航栏背景图和透明效果

图片[2]-新锐博客

/** 导航栏添加背景图和透明效果  */
header {
    background-color: rgba(255, 255, 255, 0.96);
    background-image: url(your_img_url);
    background-position: center right;
    background-size: auto 100%;
    box-shadow: 0px 5px 40px 0px rgba(17,58,93,0.1);
}
.menu-header-plane > ul {
    background-color: rgba(255, 255, 255, 0.96);
}

首页文章添加间距
.post-item {
    margin-bottom: 20px;
}

底部ICP备案信息居中
.core-footer {
    position: relative;
}
.icp-warp {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

侧边栏添加滚动播报
<div id="scroll-broadcast">
    <div id="container-box-1">
        <div class="container-box-1-1">每天来逛逛我的博客,会让你</div>
        <div id="flip-box-1">
            <!-- 滚动内容结构保持不变 -->
        </div>
        <div class="container-box-1-2">你好我也好,不要忘记哦!</div>
    </div>
</div>
<style>
    #scroll-broadcast {margin: -10px;}
    #container-box-1{
        background: linear-gradient(45deg, #C7F5FE 10%, #FCC8F8 40%, #EAB4F8 60%, #F3F798 90%);
        border-radius: 10px;
        padding: 10px;
    }
    /* 其他样式保持不变 */
</style>

底部黑暗明亮模式切换

本代码来源于阿蛮君博客:https://www.amjun.com/1462.html

.footer-plane{background: #22292d !important;color: #b3c0ce !important;}
/** 修改底部颜色 */
.footer-plane {
   background: #fff;
   color: #999;
   box-shadow: 0 0.5px 0.5px 1px rgb(0 0 0 / 10%);
    padding: 20px 30px 30px 30px;
}
.footer-plane a {
   color: unset!important;
}
.footer-aside-box {
   margin-bottom: unset!important;
}
.footer-info a:hover {
    color:var(--MaincolorHover) !important;
}

文章版权信息
<fieldset style="border: 1.5px dashed #008cff; padding: 10px; border-radius: 5px; line-height: 2em;font-weight: 700;color: var(--key-color);background-color: var(--body-bg-color);">
    <legend align="center" style="margin-bottom: -2px;width: 30%;text-align: center; background-color: #008cff; border-radius: 999px; background-image: linear-gradient(to right, #FFCC99, #FF99CC);border: 1.5px dashed #008cff;">
        版权声明
    </legend>
    <span class="btn-info btn-xs">1</span> 本文章标题:<span style="color: #3333ff"><span style="color: #09ace2; font-size: 15px"><strong>#postname# </strong></span></span><br>
    <span class="btn-info btn-xs">2</span> 本文章地址:<font color="#09ace2">#url# </font><br>
    <span class="btn-info btn-xs">3</span> 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请发送邮件至<font color="#09ace2">xxx@qq.com</font>进行删除处理。<br>
    <span class="btn-info btn-xs">4</span> 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。<br>
    <span class="btn-info btn-xs">5</span> 如您发现本站提供资源链接失效或有违规现象,请联系我们处理。<br>
</fieldset>
  • ✇新锐博客
  • WordPress底部添加当前在线人数统计莫忘
    教程 将下面的代码放到当前主题的footer.php文件中,记得在目录中创建一个名为maplers.dat 的文件。 代码 <!--显示在线人数--> <?php //首先你要有读写文件的权限,首次访问肯不显示,正常情况刷新即可 $online_log = "maplers.dat"; //保存人数的文件到根目录, $timeout = 60;//60秒内没动作,认为掉线 $entries = file($online_log); $temp = array(); for ($i=0;$i<count($entries);$i++){ $entry = explode(",",trim($entries[$i])); if(($entry[0] != getenv('REMOTE_ADDR')) && ($entry[1] > time())) { array_push($temp,$entry[0].",".$entry[1]."n"); //取出其他浏览者的信息,并去掉超时者,保存进$temp }} array_push($temp,g
     

WordPress底部添加当前在线人数统计

作者 莫忘
2023年4月22日 17:42

教程

将下面的代码放到当前主题的footer.php文件中,记得在目录中创建一个名为maplers.dat 的文件。

代码

<!--显示在线人数-->
<?php
//首先你要有读写文件的权限,首次访问肯不显示,正常情况刷新即可
$online_log = "maplers.dat"; //保存人数的文件到根目录,
$timeout = 60;//60秒内没动作,认为掉线
$entries = file($online_log);
$temp = array();
for ($i=0;$i<count($entries);$i++){
$entry = explode(",",trim($entries[$i]));
if(($entry[0] != getenv('REMOTE_ADDR')) && ($entry[1] > time())) {
array_push($temp,$entry[0].",".$entry[1]."n"); //取出其他浏览者的信息,并去掉超时者,保存进$temp
}}
array_push($temp,getenv('REMOTE_ADDR').",".(time() + ($timeout))."n"); //更新浏览者的时间
$maplers = count($temp); //计算在线人数
$entries = implode("",$temp);
//写入文件
$fp = fopen($online_log,"w");
flock($fp,LOCK_EX); //flock() 不能在NFS以及其他的一些网络文件系统中正常工作
fputs($fp,$entries);
flock($fp,LOCK_UN);
fclose($fp);
echo "在线人数:".$maplers."人";
?>

 

❌
❌