🎀 🌸

子比主题 – 简约页脚美化样式

子比主题 – 简约页脚美化样式

子比主题 – 简约页脚美化样式插图

部署教程:

定位:/wp-content/themes/zibll/footer.php文件,这个是子比默认的页脚文件,然后我们把子比默认的给删掉,也就是子比自带的页脚!

子比主题 – 简约页脚美化样式插图1
<style>

.zy-footer .footer-main {
    background-color: var(--main-bg-color) !important;
    color: var(--muted-color) !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.zy-footer {
    border: none !important;
    outline: none !important;
}

.zy-footer .footer-content {
    border: none !important;
    outline: none !important;
}

.zy-footer .container {
    border: none !important;
    outline: none !important;
}

.zy-footer .footer-left p,
.zy-footer .footer-right a {
    color: var(--muted-color) !important;
}

.zy-footer .footer-left p:first-child {
    color: var(--heading-color) !important;
}

.zy-footer .footer-right a {
    transition: color 0.2s ease;
}

.zy-footer .footer-right a:hover {
    color: var(--theme-color) !important;
}

.zy-footer .qrcode-popup {
    background: var(--main-bg-color) !important;
    border-color: var(--border-color) !important;
}

.zy-footer .qrcode-popup p {
    color: var(--muted-color) !important;
}

.footer-logo-light {
    display: block !important;
}

.footer-logo-dark {
    display: none !important;
}

body.zib-dark .footer-logo-light {
    display: none !important;
}

body.zib-dark .footer-logo-dark {
    display: block !important;
}

.zy-footer .footer-copyright {
    background-color: #1C2833 !important;
    color: #A9A9A9 !important;
    padding: 0;
    margin-top: 0;
    border-top: none !important;
    height: 32px;
}

.zy-footer .footer-copyright .copyright-text {
    font-size: 12px;
    color: #A9A9A9 !important;
    line-height: 32px;
    margin: 0;
}

.zy-footer .footer-copyright .copyright-text a {
    color: #A9A9A9 !important;
    text-decoration: none;
}

.zy-footer .footer-copyright .copyright-text a:hover {
    text-decoration: underline;
}

body.zib-dark .zy-footer .footer-copyright {
    background-color: #1C2833 !important;
    color: #e0e0e0 !important;
}

body.zib-dark .zy-footer .footer-copyright .copyright-text {
    color: #e0e0e0 !important;
}
</style>

<footer id="custom-footer" class="tuc-2ea177b2-1e0583-0 zy-footer tuc-2ea177b2-1e0583-0">
    <div class="tuc-2ea177b2-1e0583-0 footer-main tuc-2ea177b2-1e0583-0" style="padding: 40px 0; border-top: none; transition: background-color 0.3s ease, color 0.3s ease;">
        <div class="tuc-2ea177b2-1e0583-0 container tuc-2ea177b2-1e0583-0" style="max-width: 1200px; margin: 0 auto; padding: 0 20px;">
            <div class="tuc-2ea177b2-1e0583-0 footer-content tuc-2ea177b2-1e0583-0" style="display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 30px;">

                <div class="tuc-2ea177b2-1e0583-0 footer-left tuc-2ea177b2-1e0583-0" style="text-align: right; flex: 1; min-width: 280px;">
                    <p style="margin: 0 0 10px 0; font-size: 16px; font-weight: 500;">
                        专注优质内容分享,打造精品资源平台
                    </p>
                    <p style="margin: 0; font-size: 14px;">
                        优质资源 · 精品内容 · 专业服务
                    </p>
                </div>

                <div class="tuc-2ea177b2-1e0583-0 footer-middle tuc-2ea177b2-1e0583-0" style="flex: 0 0 auto;">
                    <img src="https://zy.nuoyo.cn/wp-content/uploads/2026/03/20260326152835941-by-01.png"
                         alt="白天网站LOGO"
                         class="tuc-2ea177b2-1e0583-0 footer-logo-light tuc-2ea177b2-1e0583-0"
                         style="width: 200px; height: auto;" />
                    <img src="https://zy.nuoyo.cn/wp-content/uploads/2026/03/20260326152835941-by-01.png"
                         alt="夜晚网站LOGO"
                         class="tuc-2ea177b2-1e0583-0 footer-logo-dark tuc-2ea177b2-1e0583-0"
                         style="width: 200px; height: auto;" />
                </div>

                <div class="tuc-2ea177b2-1e0583-0 footer-right tuc-2ea177b2-1e0583-0" style="text-align: left; flex: 1; min-width: 280px;">
                    <div class="tuc-2ea177b2-1e0583-0 footer-nav-row1 tuc-2ea177b2-1e0583-0" style="margin-bottom: 10px;">
                        <a href="<?php echo home_url('/'); ?>" style="text-decoration: none; margin-right: 20px; font-size: 14px;">首页</a>
                        <a href="<?php echo home_url('/about'); ?>" style="text-decoration: none; margin-right: 20px; font-size: 14px;">关于我们</a>
                        <a href="javascript:;" class="tuc-2ea177b2-1e0583-0 qrcode-trigger tuc-2ea177b2-1e0583-0" style="text-decoration: none; margin-right: 20px; font-size: 14px; position: relative; display: inline-block;">
                            微信联系
                            <div class="tuc-2ea177b2-1e0583-0 qrcode-popup tuc-2ea177b2-1e0583-0" style="display: none; position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 999; padding: 10px; border: 1px solid #eee; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: background-color 0.3s ease, border-color 0.3s ease;">
                                <div style="width: 120px; height: 120px; overflow: hidden; margin: 0 auto;">
                                    <img src="https://www.tfbkw.com/wp-content/themes/ZibTF/img/p1.svg
" alt="微信二维码" style="width: 100%; height: 100%; object-fit: contain; display: block;" />
                                </div>
                                <p style="margin: 5px 0 0 0; font-size: 12px; text-align: center; white-space: nowrap;">扫码添加微信</p>
                            </div>
                        </a>
                    </div>

                    <div class="tuc-2ea177b2-1e0583-0 footer-nav-row2 tuc-2ea177b2-1e0583-0">
                        <a href="<?php echo home_url('/privacy'); ?>" style="text-decoration: none; margin-right: 20px; font-size: 14px;">隐私政策</a>
                        <a href="<?php echo home_url('/contact'); ?>" style="text-decoration: none; margin-right: 20px; font-size: 14px;">联系我们</a>
                        <a href="javascript:;" class="tuc-2ea177b2-1e0583-0 qrcode-trigger tuc-2ea177b2-1e0583-0" style="text-decoration: none; margin-right: 20px; font-size: 14px; position: relative; display: inline-block;">
                            APP下载
                            <div class="tuc-2ea177b2-1e0583-0 qrcode-popup tuc-2ea177b2-1e0583-0" style="display: none; position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 999; padding: 10px; border: 1px solid #eee; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: background-color 0.3s ease, border-color 0.3s ease;">
                                <div style="width: 120px; height: 120px; overflow: hidden; margin: 0 auto;">
                                    <img src="https://www.tfbkw.com/wp-content/themes/ZibTF/img/p1.svg
" alt="APP下载二维码" style="width: 100%; height: 100%; object-fit: contain; display: block;" />
                                </div>
                                <p style="margin: 5px 0 0 0; font-size: 12px; text-align: center; white-space: nowrap;">扫码下载APP</p>
                            </div>
                        </a>
                        <a href="<?php echo home_url('/about'); ?>" style="text-decoration: none; margin-right: 20px; font-size: 14px;">选择我们</a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 底部版权 -->
    <div class="tuc-2ea177b2-1e0583-0 footer-copyright tuc-2ea177b2-1e0583-0" style="text-align: center; display: flex; align-items: center; justify-content: center; min-height: 30px;">
        <div class="tuc-2ea177b2-1e0583-0 container tuc-2ea177b2-1e0583-0" style="max-width: 1200px; margin: 0 auto; padding: 0 20px;">
            <p class="tuc-2ea177b2-1e0583-0 copyright-text tuc-2ea177b2-1e0583-0" style="margin: 0;">
                © <?php echo date('Y'); ?> 你的网站名称 版权所有 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">粤ICP备XXXXXXX号</a>
            </p>
        </div>
    </div>

    <script>
        (function() {
            'use strict';

            function isDarkMode() {
                const bgColor = getComputedStyle(document.body).backgroundColor;
                let isDarkByColor = false;

                if (bgColor) {
                    const match = bgColor.match(/rgb((d+),s*(d+),s*(d+))/);
                    if (match) {
                        const r = parseInt(match[1]);
                        const g = parseInt(match[2]);
                        const b = parseInt(match[3]);
                        const brightness = (r * 299 + g * 587 + b * 114) / 1000;
                        isDarkByColor = brightness < 128;
                    }
                }

                return document.body.classList.contains('zib-dark') ||
                       document.body.classList.contains('dark') ||
                       document.documentElement.classList.contains('zib-dark') ||
                       document.documentElement.classList.contains('dark') ||
                       document.documentElement.getAttribute('data-theme') === 'dark' ||
                       isDarkByColor;
            }

            function updateLogo() {
                const light = document.querySelector('.footer-logo-light');
                const dark = document.querySelector('.footer-logo-dark');

                if (light && dark) {
                    const isDark = isDarkMode();
                    if (isDark) {
                        light.style.setProperty('display', 'none', 'important');
                        dark.style.setProperty('display', 'block', 'important');
                    } else {
                        light.style.setProperty('display', 'block', 'important');
                        dark.style.setProperty('display', 'none', 'important');
                    }
                }
            }

            function initFooterLogo() {
                const lightLogo = document.querySelector('.footer-logo-light');
                const darkLogo = document.querySelector('.footer-logo-dark');

                if (lightLogo && darkLogo) {
                    
                    if (window.footerLogoInterval) {
                        clearInterval(window.footerLogoInterval);
                    }

                    updateLogo();

                    const observer = new MutationObserver(function(mutations) {
                        updateLogo();
                    });

                    observer.observe(document.body, {
                        attributes: true,
                        attributeFilter: ['class']
                    });

                    observer.observe(document.documentElement, {
                        attributes: true,
                        attributeFilter: ['class', 'data-theme']
                    });

                } else {
                    
                    if (!window.footerLogoInterval) {
                        window.footerLogoInterval = setInterval(initFooterLogo, 200);
                        setTimeout(function() {
                            if (window.footerLogoInterval) {
                                clearInterval(window.footerLogoInterval);
                            }
                        }, 10000);
                    }
                }
            }

            function initQrcodePopup() {
                const triggers = document.querySelectorAll('.qrcode-trigger');
                triggers.forEach(function(trigger) {
                    const popup = trigger.querySelector('.qrcode-popup');
                    if (popup) {
                        trigger.addEventListener('mouseenter', function() {
                            popup.style.display = 'block';
                        });
                        trigger.addEventListener('mouseleave', function() {
                            popup.style.display = 'none';
                        });
                    }
                });
            }

            document.addEventListener('DOMContentLoaded', function() {
                initFooterLogo();
                initQrcodePopup();
            });
        })();
    </script>

    <?php do_action('zib_footer'); ?>
</footer>

本站资源均为网友推荐收集整理而来,请勿商业运营,仅供学习和研究,请在下载后24小时内删除!!
© 版权声明
THE END
点赞6
评论 抢沙发

请登录后发表评论

    暂无评论内容