<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Argon &#8211; 良的世界</title>
	<atom:link href="https://www.lemonary.cn/tag/argon/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lemonary.cn</link>
	<description></description>
	<lastBuildDate>Thu, 09 Apr 2026 09:55:08 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.lemonary.cn/wp-content/uploads/2024/12/profile-150x150.jpg</url>
	<title>Argon &#8211; 良的世界</title>
	<link>https://www.lemonary.cn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>WordPress中Argon主题顶栏搜索框挤不下的问题</title>
		<link>https://www.lemonary.cn/wordpress%e4%b8%adargon%e4%b8%bb%e9%a2%98%e9%a1%b6%e6%a0%8f%e6%90%9c%e7%b4%a2%e6%a1%86%e6%8c%a4%e4%b8%8d%e4%b8%8b%e7%9a%84%e9%97%ae%e9%a2%98/</link>
					<comments>https://www.lemonary.cn/wordpress%e4%b8%adargon%e4%b8%bb%e9%a2%98%e9%a1%b6%e6%a0%8f%e6%90%9c%e7%b4%a2%e6%a1%86%e6%8c%a4%e4%b8%8d%e4%b8%8b%e7%9a%84%e9%97%ae%e9%a2%98/#respond</comments>
		
		<dc:creator><![CDATA[shine]]></dc:creator>
		<pubDate>Wed, 04 Dec 2024 02:10:27 +0000</pubDate>
				<category><![CDATA[建站记录]]></category>
		<category><![CDATA[Argon]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.lemonary.cn/?p=775</guid>

					<description><![CDATA[一、问题描述 家里电脑屏幕比较大一直没有注意到这个问题，在用小笔记本访问页面时发现在点击顶栏搜索框时，搜索框变 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="一、问题描述">一、问题描述</h2>



<p class="wp-block-paragraph">家里电脑屏幕比较大一直没有注意到这个问题，在用小笔记本访问页面时发现在点击顶栏搜索框时，搜索框变长会导致不太美观的情况，如图：</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="67" src="https://www.lemonary.cn/wp-content/uploads/2024/12/image-11-1024x67.png" alt="" class="wp-image-776" srcset="https://www.lemonary.cn/wp-content/uploads/2024/12/image-11-1024x67.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-11-300x20.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-11-768x50.png 768w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-11-1536x100.png 1536w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-11.png 1807w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">点击前</figcaption></figure>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="88" src="https://www.lemonary.cn/wp-content/uploads/2024/12/image-12-1024x88.png" alt="" class="wp-image-777" srcset="https://www.lemonary.cn/wp-content/uploads/2024/12/image-12-1024x88.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-12-300x26.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-12-768x66.png 768w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-12-1536x132.png 1536w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-12.png 1789w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">点击后</figcaption></figure>



<p class="wp-block-paragraph">由于不太熟悉使用浏览器的F12功能，始终没有定位控制搜索框变化后长度的属性配置，导致该问题困扰了我一天的时间，终于在反复的尝试下添加了一个属性解决了这个问题。</p>



<h2 class="wp-block-heading" id="二、问题解决">二、问题解决</h2>



<p class="wp-block-paragraph">首先找到变化后的搜索框元素，如图</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="523" src="https://www.lemonary.cn/wp-content/uploads/2024/12/image-13-1024x523.png" alt="" class="wp-image-778" srcset="https://www.lemonary.cn/wp-content/uploads/2024/12/image-13-1024x523.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-13-300x153.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-13-768x392.png 768w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-13-1536x785.png 1536w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-13-2048x1046.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">在之前添加的CSS样式文件additionalcss.php中添加如下代码：【也可以直接添加到外观——自定义——额外CSS】</p>



<pre class="wp-block-code"><code>/*顶栏搜索框长度控制*/
input#navbar_search_input {
    max-width: fit-content;
}</code></pre>



<p class="wp-block-paragraph">修改后效果图：</p>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1024" height="56" src="https://www.lemonary.cn/wp-content/uploads/2024/12/image-14-1024x56.png" alt="" class="wp-image-781" srcset="https://www.lemonary.cn/wp-content/uploads/2024/12/image-14-1024x56.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-14-300x16.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-14-768x42.png 768w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-14-1536x84.png 1536w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-14.png 1779w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">我也不清楚这个属性是什么意思，我就是胡乱试试出来的，感兴趣的朋友可以自行研究。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lemonary.cn/wordpress%e4%b8%adargon%e4%b8%bb%e9%a2%98%e9%a1%b6%e6%a0%8f%e6%90%9c%e7%b4%a2%e6%a1%86%e6%8c%a4%e4%b8%8d%e4%b8%8b%e7%9a%84%e9%97%ae%e9%a2%98/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress中Argon主题顶栏菜单图标</title>
		<link>https://www.lemonary.cn/wordpress%e4%b8%adargon%e4%b8%bb%e9%a2%98%e9%a1%b6%e6%a0%8f%e8%8f%9c%e5%8d%95%e5%9b%be%e6%a0%87/</link>
					<comments>https://www.lemonary.cn/wordpress%e4%b8%adargon%e4%b8%bb%e9%a2%98%e9%a1%b6%e6%a0%8f%e8%8f%9c%e5%8d%95%e5%9b%be%e6%a0%87/#respond</comments>
		
		<dc:creator><![CDATA[shine]]></dc:creator>
		<pubDate>Tue, 26 Nov 2024 06:15:10 +0000</pubDate>
				<category><![CDATA[建站记录]]></category>
		<category><![CDATA[Argon]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[图标]]></category>
		<guid isPermaLink="false">https://lemonary.cn/?p=424</guid>

					<description><![CDATA[一、概述 顶栏菜单如果是纯文字的话，会显得比较单调，在文字前增加上图标会更美观。 效果呈现： 二、添加方法 首 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="一、概述">一、概述</h2>



<p class="wp-block-paragraph">顶栏菜单如果是纯文字的话，会显得比较单调，在文字前增加上图标会更美观。</p>



<p class="wp-block-paragraph">效果呈现：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="85" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-300.png" alt="" class="wp-image-2140" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-300.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-300-300x25.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-300-768x64.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading" id="二、添加方法">二、添加方法</h2>



<p class="wp-block-paragraph">首先，打开<a href="https://github.com/solstice23/argon-theme" target="_blank" rel="noopener">Argon主题的Github地址</a>。</p>



<p class="wp-block-paragraph">下拉，找到<a href="https://argon-docs.solstice23.top/" target="_blank" rel="noopener">Argon-Theme 文档 </a>，点开。</p>



<p class="wp-block-paragraph">左侧，点及<a href="https://argon-docs.solstice23.top/#/icon" target="_blank" rel="noopener">图标</a>。</p>



<p class="wp-block-paragraph">使用&nbsp;<code>&lt;i class="fa fa-xxxx"&gt;&lt;/i&gt;</code>&nbsp;添加图标。其中 xxxx 为图标名。</p>



<p class="wp-block-paragraph">请访问<a href="https://fontawesome.com/v4/icons/" target="_blank" rel="noreferrer noopener">Font Awesome 4</a>图标库自行查询对应的图标名。</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">备注<br>文本和图标之间建议添加一个空格来保证美观。</p>
</blockquote>



<h2 class="wp-block-heading" id="另注">另注</h2>



<p class="wp-block-paragraph">将顶栏菜单中的“说说”改成其他名字，例如：笔记、日记、想法……</p>



<p class="wp-block-paragraph">除了需要在页面配置界面将“说说”替换掉，还需要在主题文件编辑器中将shuoshuo.php中的“说说”替换</p>



<pre class="wp-block-code"><code>&lt;!-- 13 行 --&gt;
&lt;h3 class="text-black"&gt;&lt;?php _e('日记', 'argon');?&gt;&lt;/h3&gt;
&lt;!-- 21 行 --&gt;
&lt;?php echo wp_count_posts('shuoshuo','') -&gt; publish; ?&gt; &lt;?php _e('篇日记', 'argon');?&gt;</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lemonary.cn/wordpress%e4%b8%adargon%e4%b8%bb%e9%a2%98%e9%a1%b6%e6%a0%8f%e8%8f%9c%e5%8d%95%e5%9b%be%e6%a0%87/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Argon主题代码修改记录</title>
		<link>https://www.lemonary.cn/argon%e4%b8%bb%e9%a2%98%e4%bb%a3%e7%a0%81%e4%bf%ae%e6%94%b9%e8%ae%b0%e5%bd%95/</link>
					<comments>https://www.lemonary.cn/argon%e4%b8%bb%e9%a2%98%e4%bb%a3%e7%a0%81%e4%bf%ae%e6%94%b9%e8%ae%b0%e5%bd%95/#respond</comments>
		
		<dc:creator><![CDATA[shine]]></dc:creator>
		<pubDate>Wed, 20 Nov 2024 08:00:59 +0000</pubDate>
				<category><![CDATA[建站记录]]></category>
		<category><![CDATA[Argon]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://lemonary.cn/?p=276</guid>

					<description><![CDATA[WordPress根目录下创建目录theme-modify，将所有需要添加的自定义脚本放到这个目录下。 一、修 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">WordPress根目录下创建目录theme-modify，将所有需要添加的自定义脚本放到这个目录下。</p>



<h2 class="wp-block-heading" id="一、修改记录">一、修改记录</h2>



<h3 class="wp-block-heading" id="1.1-回到顶部图标修改">1.1 回到顶部图标修改</h3>



<p class="wp-block-paragraph">创建文件backtotop.php，编辑如下代码：</p>



<pre class="wp-block-code"><code>&lt;!-- 回到顶部图标修改 开始 --&gt;
&lt;script&gt;
	$("#fabtn_back_to_top &gt; span &gt; i").removeClass("fa fa-angle-up");
	$("#fabtn_back_to_top &gt; span &gt; i").addClass("fa fa-arrow-up");
&lt;/script&gt;
&lt;!-- 回到顶部图标修改 结束 --&gt;</code></pre>



<p class="wp-block-paragraph">代码引入：主题文件编辑器的footer.php，在标签<code>&lt;button id="fabtn_back_to_top"……&gt;&lt;/button&gt;</code>中添加：</p>



<pre class="wp-block-code"><code>&lt;!-- 回顶图标修改开始 --&gt;
&lt;?php require('./theme-modify/backtotop.php'); ?&gt;
&lt;!-- 回顶图标修改结束 --&gt;</code></pre>



<h3 class="wp-block-heading" id="1.2-卡片3D效果">1.2 卡片3D效果</h3>



<p class="wp-block-paragraph">创建文件card3d.php，编辑如下代码：</p>



<pre class="wp-block-code"><code>&lt;!--卡片3D效果脚本CDN &lt;script src="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper/vanilla3D/vanilla-tilt.min.js"&gt;&lt;/script&gt; 已注释--&gt;
&lt;!--卡片3D效果脚本，改为引入本地脚本--&gt;&lt;script src="/wp-content/themes/argon-theme-master/vanilla-tilt.min.js"&gt;&lt;/script&gt;
&lt;!--判断是否为Safari浏览器--&gt;&lt;script&gt;var isSafari = /Safari/.test(navigator.userAgent) &amp;&amp; !/Chrome/.test(navigator.userAgent);&lt;/script&gt;
 
&lt;!--以下内容每次跳转新页面都执行，pjax额外处理--&gt;
&lt;script&gt;
window.pjaxLoaded = function () {
    //站点概览点击头像或作者名跳转到关于页
 &nbsp; &nbsp;$("#leftbar_overview_author_image").wrapAll('&lt;a href="/关于" /a&gt;');
 &nbsp; &nbsp;$("#leftbar_overview_author_name").wrapAll('&lt;a href="/关于" /a&gt;');
 &nbsp; &nbsp;//说说标题替换为日记
 &nbsp; &nbsp;if (window.location.pathname == "/idea") {
        if ($("#content &gt; div.page-information-card-container &gt; div &gt; div").length &gt; 0) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//var temp_str = document.querySelector("#content &gt; div.page-information-card-container &gt; div &gt; div").innerHTML.replace(/说说/g, "日记");
            document.querySelector("#content &gt; div.page-information-card-container &gt; div &gt; div").innerHTML = temp_str;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//$("#content &gt; div.page-information-card-container &gt; div &gt; div &gt; p").append('&lt;br&gt;由&lt;a href="https://t.me/yaquews" target="_blank"&gt;朋友圈&lt;/a&gt;自动同步');
            $("#content &gt; div.page-information-card-container &gt; div &gt; div &gt; p &gt; i").removeClass("fa fa-quote-left");
            $("#content &gt; div.page-information-card-container &gt; div &gt; div &gt; p &gt; i").addClass("fa fa-bolt");
        }
    }
    //卡片3D效果
    if (screen.width &gt;= 768 &amp;&amp; !isSafari) {
        VanillaTilt.init(document.querySelectorAll("article.post:not(.post-full), .shuoshuo-preview-container"), {
            reverse: true,  // reverse the tilt direction
            max: 8,     // max tilt rotation (degrees)
            startX: 0,      // the starting tilt on the X axis, in degrees.
            startY: 0,      // the starting tilt on the Y axis, in degrees.
            perspective: 1000,   // Transform perspective, the lower the more extreme the tilt gets.
            scale: 1.02,      // 2 = 200%, 1.5 = 150%, etc..
            speed: 600,    // Speed of the enter/exit transition
            transition: false,   // Set a transition on enter/exit.
            axis: "y",    // What axis should be banned. Can be "x", "y", or null
            reset: true,   // If the tilt effect has to be reset on exit.
            easing: "cubic-bezier(.03,.98,.52,.99)",    // Easing on enter/exit.
            glare: false,  // if it should have a "glare" effect
            "max-glare": 0.8,      // the maximum "glare" opacity (1 = 100%, 0.5 = 50%)
            "glare-prerender": false,  // false = VanillaTilt creates the glare elements for you, otherwise
            // you need to add .js-tilt-glare&gt;.js-tilt-glare-inner by yourself
            "mouse-event-element": null,   // css-selector or link to HTML-element what will be listen mouse events
            gyroscope: true,   // Boolean to enable/disable device orientation detection,
            gyroscopeMinAngleX: -45,    // This is the bottom limit of the device angle on X axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the left border of the element;
            gyroscopeMaxAngleX: 45,     // This is the top limit of the device angle on X axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the right border of the element;
            gyroscopeMinAngleY: -45,    // This is the bottom limit of the device angle on Y axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the top border of the element;
            gyroscopeMaxAngleY: 45,     // This is the top limit of the device angle on Y axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the bottom border of the element;
        })
    }
}
window.pjaxLoaded();
&lt;/script&gt;
 
&lt;!--根据滚动高度改变顶栏透明度--&gt;
&lt;script&gt;
!function () {
    let toolbar = document.getElementById("navbar-main");
    let $bannerContainer = $("#banner_container");
    let $content = $("#content");
 
    let startTransitionHeight;
    let endTransitionHeight;
    let maxOpacity = 0.65;
 
    startTransitionHeight = $bannerContainer.offset().top - 75;
    endTransitionHeight = $content.offset().top - 75;
 
    $(window).resize(function () {
        startTransitionHeight = $bannerContainer.offset().top - 75;
        endTransitionHeight = $content.offset().top - 75;
    });
 
    function changeToolbarTransparency() {
        let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
        if (scrollTop &lt; startTransitionHeight) {
            toolbar.style.setProperty('background-color', 'rgba(var(--toolbar-color), 0)', 'important');
            toolbar.style.setProperty('box-shadow', 'none');
            toolbar.style.setProperty('-webkit-box-shadow', 'none');
            if (argonConfig.toolbar_blur) {
                toolbar.style.setProperty('backdrop-filter', 'blur(0px)');
                toolbar.style.setProperty('-webkit-backdrop-filter', 'blur(0px)');
            }
            toolbar.classList.add("navbar-ontop");
            return;
        }
        if (scrollTop &gt; endTransitionHeight) {
            toolbar.style.setProperty('background-color', 'rgba(var(--toolbar-color), ' + maxOpacity + ')', 'important');
            toolbar.style.setProperty('box-shadow', '');
            toolbar.style.setProperty('-webkit-box-shadow', '');
            if (argonConfig.toolbar_blur) {
                toolbar.style.setProperty('backdrop-filter', 'blur(16px)');
                toolbar.style.setProperty('-webkit-backdrop-filter', 'blur(16px)');
            }
            toolbar.classList.remove("navbar-ontop");
            return;
        }
        let transparency = (scrollTop - startTransitionHeight) / (endTransitionHeight - startTransitionHeight) * maxOpacity;
        toolbar.style.setProperty('background-color', 'rgba(var(--toolbar-color), ' + transparency, 'important');
        toolbar.style.setProperty('box-shadow', '');
        if (argonConfig.toolbar_blur) {
            toolbar.style.setProperty('backdrop-filter', 'blur(16px)');
            toolbar.style.setProperty('-webkit-backdrop-filter', 'blur(16px)');
        }
        toolbar.classList.remove("navbar-ontop");
    }
    changeToolbarTransparency();
    document.addEventListener("scroll", changeToolbarTransparency, { passive: true });
}();
&lt;/script&gt;</code></pre>



<p class="wp-block-paragraph">代码引入：主题代码编辑器的footer.php中：在末尾<code>&lt;/body&gt;</code>上方添加：</p>



<pre class="wp-block-code"><code>&lt;!-- 卡片3D效果 开始 --&gt;
&lt;?php require('./theme-modify/card3d.php'); ?&gt;
&lt;!-- 卡片3D效果 结束 --&gt;</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">注意：<br>新增上述卡片3D效果代码后，页面初次加载时并不会执行这部分脚本内容。<br>在WordPress配置项中，找到Argon主题选项的脚本部分可以看到：<br>当页面第一次载入时，window.pjaxLoaded 中的脚本不会执行<br>所以您可以手动执行window.pjaxLoaded();来让页面初次加载时也执行脚本。<br>如图：<br></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="254" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-281.png" alt="" class="wp-image-2115" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-281.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-281-300x74.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-281-768x191.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</blockquote>



<p class="wp-block-paragraph">所以，解决方法就是在此处将window.pjaxLoaded();添加到页尾脚本中。【页头脚本无效】</p>



<pre class="wp-block-code"><code>&lt;script&gt;window.pjaxLoaded();&lt;/script&gt;</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="403" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-282.png" alt="" class="wp-image-2117" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-282.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-282-300x118.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-282-768x302.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading" id="1.3-主题额外CSS样式">1.3 主题额外CSS样式</h3>



<p class="wp-block-paragraph">创建文件additionalcss.php，编辑如下代码：</p>



<pre class="wp-block-code"><code>&lt;!-- 主题额外 CSS 开始 --&gt;
&lt;style&gt;
/*=========字体设置============*/
 
/*网站字体*/
/*原则上你可以设置多个字体，然后在不同的部位使用不同的字体。*/
/*
HanYiXingKaiJian-1.woff2	似行书
YrdzslHeavy.woff2		和默认差不多
方正FW筑紫A圆 简.woff2		清除，好看
*/

@font-face{
    font-family:btfFont;
    src:
    url(https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/fonts/方正FW筑紫A圆 简.woff2) format('woff2')
}
body{
    font-family:"btfFont" !important
}
 
/*设置加粗字体颜色*/
strong {
    /*白天*/
    color: #A7727D;
}
html.darkmode strong {
    /*夜晚*/
    color: #FAAB78;
}
 
/*说说预览模式的代码字体颜色*/
pre {
    /*白天*/
    color: #A7727D;
}
html.darkmode pre {
    /*夜晚*/
    color: #FAAB78;
}
 
/*横幅字体大小*/
.banner-title {
  font-size: 3em;
}
.banner-subtitle{
  font-size: 33px;
}
 
/*文章标题字体大小*/
//.post-title {
//    font-size: 30px
//}
 
/*正文字体大小（不包含代码）*/
//.post-content p{
//    font-size: 1rem;
//}
//li{
//    font-size: 1rem;
//}
 
/*评论区字体大小*/
//p {
//    font-size: 1rem
//}
 
/*评论发送区字体大小*/
//.form-control{
//    font-size: 1rem
//}
 
/*评论勾选项目字体大小*/
.custom-checkbox .custom-control-input~.custom-control-label{
    font-size: 1rem
}
/*评论区代码的强调色*/
code {
  color: rgba(var(--themecolor-rgbstr));
}
 
/*说说字体大小和颜色设置*/
//.shuoshuo-title {
//    font-size: 25px;
/*  color: rgba(var(--themecolor-rgbstr)); */
}
 
/*尾注字体大小*/
//.additional-content-after-post{
//    font-size: 1.2rem
//}
 

/*========颜色设置===========*/
 
/*文章或页面的正文颜色*/
body{
    color:#364863
}
 
/*引文属性设置*/
blockquote {
    /*添加弱主题色为背景色*/
    background: rgba(var(--themecolor-rgbstr), 0.1) !important;
    width: 100%
}
 
/*引文颜色 建议用主题色*/
:root {
    /*也可以用类似于--color-border-on-foreground-deeper: #009688;这样的命令*/
    --color-border-on-foreground-deeper: rgba(var(--themecolor-rgbstr));
}
 
/*左侧菜单栏突出颜色修改*/
.leftbar-menu-item &gt; a:hover, .leftbar-menu-item.current &gt; a{
    background-color: #f9f9f980;
}
 
/*站点概览分隔线颜色修改*/
.site-state-item{
    border-left: 1px solid #aaa;
}
.site-friend-links-title {
    border-top: 1px dotted #aaa;
}
#leftbar_tab_tools ul li {
    padding-top: 3px;
    padding-bottom: 3px;
    border-bottom:none;
}
html.darkmode #leftbar_tab_tools ul li {
    border-bottom:none;
}
 
/*左侧栏搜索框的颜色*/
button#leftbar_search_container {
    background-color: transparent;
}
/*隐藏左侧栏搜索框*/
.leftbar-menu {display: none;}
.leftbar-search-button {display: none;}
#leftbar_part2_inner:before {display: none;}
@media screen and (min-width: 900px){
        .leftbar-banner {
        border-radius: var(--card-radius);
       	}
}

/*顶栏搜索框长度控制*/
input#navbar_search_input {
    max-width: fit-content;
}


/*========透明设置===========*/
 
/*白天卡片背景透明*/
.card{
    background-color:rgba(255, 255, 255, 0.85) !important;
    /*backdrop-filter:blur(6px);*//*毛玻璃效果主要属性*/
    -webkit-backdrop-filter:blur(6px);
}
 
/*小工具栏背景完全透明*/
/*小工具栏是card的子元素，如果用同一个透明度会叠加变色，故改为完全透明*/
.card .widget,.darkmode .card .widget,#post_content &gt; div &gt; div &gt; div.argon-timeline-card.card.bg-gradient-secondary.archive-timeline-title{
    background-color:#ffffff00 !important;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
}
.emotion-keyboard,#fabtn_blog_settings_popup{
    background-color:rgba(255, 255, 255, 0.95) !important;
}
 
/*分类卡片透明*/
.bg-gradient-secondary{
    background:rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter:blur(10px);
}
 
/*夜间透明*/
html.darkmode.bg-white,html.darkmode .card,html.darkmode #footer{
    background:rgba(66, 66, 66, 0.9) !important;
}
html.darkmode #fabtn_blog_settings_popup{
    background:rgba(66, 66, 66, 0.95) !important;
}
 
/*标签背景
.post-meta-detail-tag {
    background:rgba(255, 255, 255, 0.5)!important;
}*/
 
 
/*========排版设置===========*/
 
/*左侧栏层级置于上层*/
#leftbar_part1 {
    z-index: 1;
}
 
/*分类卡片文本居中*/
#content &gt; div.page-information-card-container &gt; div &gt; div{
    text-align:center;
}
 
/*子菜单对齐及样式调整*/
.dropdown-menu .dropdown-item&gt;i{
    width: 10px;
}
.dropdown-menu&gt;a {
    color:var(--themecolor);
}
.dropdown-menu{
    min-width:max-content;
}
.dropdown-menu .dropdown-item {
    padding: .5rem 1.5rem 0.5rem 1rem;
}
.leftbar-menu-subitem{
    min-width:max-content;
}
.leftbar-menu-subitem .leftbar-menu-item&gt;a{
    padding: 0rem 1.5rem 0rem 1rem;
}
 
/*左侧栏边距修改*/
//.tab-content{
//    padding:10px 0px 0px 0px !important;
//}
.site-author-links{
    padding:0px 0px 0px 10px ;
}
/*左侧栏头像自动缩放*/
#leftbar_overview_author_image:hover{
        transform: scale(1.2);
        filter: brightness(150%);
}
/*目录位置偏移修改*/
#leftbar_catalog{
    margin-left: 0px;
}
/*目录条目边距修改*/
#leftbar_catalog .index-link{
    padding: 4px 4px 4px 4px;
}
/*左侧栏小工具栏字体缩小*/
#leftbar_tab_tools{
    font-size: 14px;
}
 
/*正文图片边距修改*/
article figure {
    //margin:0;
    margin-top: 0px;     /* 设置上方外边距为0像素 */
    margin-right: 0px;   /* 设置右侧外边距为0像素 */
    margin-bottom: 15px; /* 设置下方外边距为15像素 */
    margin-left: 0px;    /* 设置左侧外边距为0像素 */
}
/*正文图片居中显示*/
.fancybox-wrapper {
    margin: auto;
}
/*正文表格样式修改*/
/*
article table &gt; tbody &gt; tr &gt; td,
article table &gt; tbody &gt; tr &gt; th,
article table &gt; tfoot &gt; tr &gt; td,
article table &gt; tfoot &gt; tr &gt; th,
article table &gt; thead &gt; tr &gt; td,
article table &gt; thead &gt; tr &gt; th{
    padding: 8px 10px;
    border: 1px solid;
}*/
/*表格居中样式*/
//.wp-block-table.aligncenter{margin:10px auto;}
 
/*回顶图标放大*/
button#fabtn_back_to_top, button#fabtn_go_to_comment, button#fabtn_toggle_blog_settings_popup, button#fabtn_toggle_sides, button#fabtn_open_sidebar{
    font-size: 1.2rem;
}
 
/*顶栏菜单*/
/*这里也可以设置刚刚我们设置的btfFont字体。试试看！*/
.navbar-nav .nav-link {
    font-size: 0.9rem;
    /*font-family: 'btfFont';*/
}
.nav-link-inner--text {
    /*顶栏菜单字体大小*/
    font-size: 0.9rem;
}
.navbar-nav .nav-item {
    margin-right:0;
}
.mr-lg-5, .mx-lg-5 {
    margin-right:1rem !important;
}
.navbar-toggler-icon {
    width: 1.5rem;
    height: 1.5rem;
}
.navbar-expand-lg .navbar-nav .nav-link {
    padding-right: 0.9rem;
    padding-left: 1rem;
}
 
/*顶栏图标*/
.navbar-brand {
    font-family: 'Noto Serif SC',serif;
    font-size: 1.6rem;
    -webkit-text-fill-color: transparent;
    background: linear-gradient(94.75deg, rgb(60, 172, 247) 0%, rgb(131, 101, 253) 43.66%, rgb(255, 141, 112) 64.23%, rgb(247, 201, 102) 83.76%, rgb(172, 143, 100) 100%);
    -webkit-background-clip: text;
    /*顶栏图标边界微调*/
    margin-right: 0rem; /*左右偏移*/
    padding-bottom: 0.3rem;
}
.navbar-brand img { 
  /* 图片高度*/
    height: 24px;
}
 
/*隐藏wp-SEO插件带来的线条阴影（不一定要装）*/
*&#91;style='position: relative; z-index: 99998;'] {
    display: none;
}
&lt;/style&gt;
&lt;!-- 主题额外 CSS 结束 --&gt;
</code></pre>



<p class="wp-block-paragraph">代码引入：主题代码编辑器的footer.php中：在末尾<code>&lt;/body&gt;</code>上方添加：</p>



<pre class="wp-block-code"><code>&lt;!-- 主题额外CSS 开始 --&gt;
&lt;?php require('./theme-modify/additionalcss.php'); ?&gt;
&lt;!-- 主题额外CSS 结束 --&gt;</code></pre>



<p class="wp-block-paragraph">或者直接添加到主题——自定义——额外CSS中</p>



<h3 class="wp-block-heading" id="1.4-时间进度条">1.4 时间进度条</h3>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">仅限Argon主题可用。</p>
</blockquote>



<p class="wp-block-paragraph">效果图：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="549" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-283.png" alt="" class="wp-image-2118" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-283.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-283-300x161.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-283-768x412.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">大致原理是基于HTML/CSS/JS定义一个时间进度条T。然后，将T插入到sidebar.php的<code>id="leftbar_part2"</code>前面，从而实现在左侧栏的目标位置（站点概览的窗口上方）植入T。</p>



<p class="wp-block-paragraph">操作步骤：</p>



<p class="wp-block-paragraph">下载progress-wrapper.php文件。下载地址：<a href="https://alistrn2.hwb0307.com/softwares/bloghelper/progress-wrapper" target="_blank" rel="noreferrer noopener">Alist</a>或者<a href="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/progress-wrapper/progress-wrapper.php" target="_blank" rel="noreferrer noopener">Github</a>。</p>



<p class="wp-block-paragraph">将progress-wrapper.php保存在WordPress根目录下的某个位置。比如，我放的位置是./theme-modify/progress-wrapper.php。</p>



<p class="wp-block-paragraph">代码引入：主题文件编辑器的sidebar.php文件中：在标签<code>&lt;div id="leftbar_part2" class="widget widget_search card bg-white shadow-sm border-0"&gt;</code>的前边添加。</p>



<pre class="wp-block-code"><code>&lt;!-- 小工具：时间进度条 开始 --&gt;
&lt;?php require('./theme-modify/progress-wrapper.php'); ?&gt;
&lt;!-- 小工具：时间进度条 结束 --&gt;</code></pre>



<p class="wp-block-paragraph">此外，progress-wrapper.php中有一些重要的参数，可根据实际情况自定义。详见下图：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="577" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-284.png" alt="" class="wp-image-2119" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-284.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-284-300x169.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-284-768x433.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">此图来源于Bensz大佬的博客</figcaption></figure>



<p class="wp-block-paragraph">百分比有2种模式，一种是yearprogress_progresstext，另一种是yearprogress_progresstext_full。full会返回一个更加精确的数字。</p>



<p class="wp-block-paragraph"><strong>时间进度条去重叠</strong>（该部分效果暂未实现）</p>



<p class="wp-block-paragraph">如果仅按上面的方法设置，存在卡片重叠现象：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="358" height="297" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-285.png" alt="" class="wp-image-2120" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-285.png 358w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-285-300x249.png 300w" sizes="auto, (max-width: 358px) 100vw, 358px" /></figure>



<p class="wp-block-paragraph">据测试，Argon主题判断向上隐藏某卡片时依据其ID标签是否为left_part1。因此，基本的思路是给时间进度条添加该标签，然后将旧标签删除（原来是属于搜索框的）。修复方法如下：</p>



<ul class="wp-block-list">
<li>给时间进度条添加leftbar_part1的ID标签：</li>
</ul>



<pre class="wp-block-code"><code>&lt;div id="leftbar_part1" class="card bg-white shadow-sm border-0"&gt;</code></pre>



<ul class="wp-block-list">
<li>将sidebar.php中原来的left_part1对应的ID标签【搜索框】删除：</li>
</ul>



<pre class="wp-block-code"><code>&lt;!--&lt;div id="leftbar_part1" class="widget widget_search card bg-white shadow-sm border-0"&gt;--&gt;</code></pre>



<h3 class="wp-block-heading" id="1.5-底部音乐播放器">1.5 底部音乐播放器</h3>



<p class="wp-block-paragraph">创建文件music.php，编辑如下代码：</p>



<pre class="wp-block-code"><code>&lt;link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"&gt;
&lt;script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"&gt;&lt;/script&gt;
&lt;script src="https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js"&gt;&lt;/script&gt;
 
&lt;meting-js 
	server="netease" 
	type="playlist" 
	id="12922403015"
	showlrc="false"
	fixed="true" 
	mini="true"
	order="random"
	loop="all"
	preload="auto"
	volume="0.3"
	mutex="true"
	//lrc-type="0"
	list-folded="false"&gt;
&lt;/meting-js&gt;</code></pre>



<p class="wp-block-paragraph">server=&#8221;netease&#8221;&nbsp;指定音乐平台为网易云，type=&#8221;song&#8221;&nbsp;指单曲类型，id=&#8221;8371854119&#8243;&nbsp;为音乐的 id（这里的 id 为打开音乐歌单，网址显示的 id）</p>



<p class="wp-block-paragraph">开启吸底模式&nbsp;fixed=&#8221;true&#8221;, 开启迷你模式&nbsp;mini=&#8221;true&#8221;, 随机播放&nbsp;order=&#8221;random&#8221;, 关闭底部歌词&nbsp;lrc-type=&#8221;0&#8243;</p>



<p class="wp-block-paragraph">注意：id 需要为自己创建的歌单，不能为我喜欢的音乐；server 可以改自己用的音乐平台，如 netease (网易云)、tencent (QQ 音乐)</p>



<p class="wp-block-paragraph">具体参数设置如下：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1008" height="920" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-286.png" alt="" class="wp-image-2121" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-286.png 1008w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-286-300x274.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-286-768x701.png 768w" sizes="auto, (max-width: 1008px) 100vw, 1008px" /></figure>



<p class="wp-block-paragraph">保险起见可将三个js文件下载并上传到服务器上。在WordPress的根目录创建aplayer文件夹，并上传文件。</p>



<pre class="wp-block-code"><code>&#91;root@dameng aplayer]# pwd
/home/wwwroot/wordpress/aplayer
&#91;root@dameng aplayer]# ll
total 80
-rw-r--r-- 1 www www 12528 Nov 26 15:28 APlayer.min.css
-rw-r--r-- 1 www www 59325 Nov 26 15:28 APlayer.min.js
-rw-r--r-- 1 www www  3472 Nov 26 15:28 Meting.min.js</code></pre>



<p class="wp-block-paragraph">再将上述代码中的路径修改，即可</p>



<pre class="wp-block-code"><code>&lt;!-- 底部音乐播放器开始 --&gt;
&lt;script&gt;
var my_data = new Date();
var my_year = document.getElementById("this-year");
my_year.innerHTML=my_data.getFullYear();
&lt;/script&gt;
&lt;script&gt;
	var my_data = new Date();
	var my_year = document.getElementById("this-year");
	my_year.innerHTML=my_data.getFullYear();
&lt;/script&gt;
&lt;link rel="stylesheet" href="/aplayer/APlayer.min.css"&gt;
&lt;script src="/aplayer/APlayer.min.js"&gt;&lt;/script&gt;
&lt;script src="/aplayer/Meting.min.js"&gt;&lt;/script&gt;
&lt;meting-js 
	server="netease" 
	type="playlist" 
	id="12922403015"
	showlrc="false"
	fixed="true" 
	mini="true"
	order="random"
	loop="all"
	preload="auto"
	volume="0.3"
	mutex="true"
	//lrc-type="0"
	list-folded="false"&gt;
&lt;/meting-js&gt;
&lt;!-- 底部音乐播放器结束 --&gt;</code></pre>



<p class="wp-block-paragraph">代码引入：主题代码编辑器的footer.php中：在末尾<code>&lt;/body&gt;</code>上方添加：</p>



<pre class="wp-block-code"><code>&lt;!-- 底部音乐播放器 开始 --&gt;
&lt;?php require('./theme-modify/music.php'); ?&gt;
&lt;!-- 底部音乐播放器 结束 --&gt;</code></pre>



<h3 class="wp-block-heading" id="1.6-页脚网站信息">1.6 页脚网站信息</h3>



<h4 class="wp-block-heading">HTML</h4>



<pre class="wp-block-code"><code>&lt;!-- HTML 开始 --&gt;
&lt;div class="github-badge-big"&gt;
        &lt;span class="badge-subject"&gt;&lt;i class="fa fa-id-card"&gt;&lt;/i&gt; 备案号 &lt;/span&gt;
        &lt;span class="badge-value bg-orange"&gt;
        &lt;!-- 备案链接 --&gt;
        &lt;a href="https://beian.miit.gov.cn/" target="_blank" one-link-mark="yes"&gt;京ICP备2024097934号&lt;/a&gt;|
        &lt;a href="https://www.beian.gov.cn/portal/index?token=e547b70c-fbe1-4c80-a4a2-857b17389a71" target="_blank" one-link-mark="yes"&gt;
        京公网安备202411151557号&lt;/a&gt;
        &lt;/span&gt;
&lt;/div&gt;
&lt;div class="github-badge-big"&gt;
        &lt;span class="badge-subject"&gt;&lt;i class="fa fa-cloud" aria-hidden="true"&gt;&lt;/i&gt; CDN&lt;/span&gt; &lt;span class="badge-value bg-red"&gt; &lt;!-- 华为云链接 --&gt; &lt;a href="https://www.huaweicloud.com/" 
        target="_blank" one-link-mark="yes"&gt;HUAWEIYUN&lt;/a&gt; &lt;/span&gt;
        &lt;span class="badge-subject"&gt;&lt;i class="fa fa-wordpress"&gt;&lt;/i&gt; Powered&lt;/span&gt;
        &lt;span class="badge-value bg-shallots"&gt;
        &lt;!-- wordpress链接 --&gt;
        &lt;a href="https://cn.wordpress.org/" target="_blank" one-link-mark="yes"&gt;
        WordPress&lt;/a&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div class="github-badge-big"&gt;
        &lt;span class="badge-subject"&gt;&lt;i class="fa fa-copyright" aria-hidden="true"&gt;&lt;/i&gt;Copyright &lt;/span&gt;
        &lt;span class="badge-value bg-purple"&gt;2024-2025&lt;/i&gt;
        &lt;a href="https://www.lemonary.cn/" target="_blank" one-link-mark="yes"&gt;@ Shine&lt;/a&gt;
        &lt;/span&gt;
&lt;/div&gt;
&lt;!-- 运行时间 --&gt;
&lt;div class="github-badge-big"&gt;
        &lt;span class="badge-subject"&gt;&lt;i class="fa fa-clock-o"&gt;&lt;/i&gt; Running Time&lt;/span&gt;&lt;span
        class="badge-value bg-apricots"&gt;&lt;span id="blog_running_days" class="odometer odometer-auto-theme"&gt;&lt;/span&gt;
        days
	&lt;span id="blog_running_hours" class="odometer odometer-auto-theme"&gt;&lt;/span&gt; H
        &lt;span id="blog_running_mins" class="odometer odometer-auto-theme"&gt;&lt;/span&gt; M
        &lt;span id="blog_running_secs" class="odometer odometer-auto-theme"&gt;&lt;/span&gt; S
        &lt;/span&gt;
&lt;/div&gt;
&lt;div class="github-badge-big"&gt;
        &lt;span class="badge-time bg-green"&gt;&lt;?php printf(' | 耗时 %.3f 秒 | 查询 %d 次 | 内存 %.2f MB |',timer_stop( 0, 3 ),get_num_queries(),memory_get_peak_usage() / 1024 / 1024);?&gt;&lt;/span&gt;&lt;br&gt;
&lt;!-- HTML 结束--&gt;</code></pre>



<p class="wp-block-paragraph">另外，页脚原主题代码部分也有些微的修改，如下：</p>



<pre class="wp-block-code"><code>&lt;span class="badge-theme"&gt;Theme &lt;a href="https://github.com/solstice23/argon-theme" target="_blank"&gt;&lt;strong&gt;Argon&lt;/strong&gt;&lt;/a&gt;&lt;?php if (get_option('argon_hide_footer_author') != 'true') {echo " By solstice23"; }?&gt;&lt;/span&gt;&lt;/div&gt;</code></pre>



<p class="wp-block-paragraph">增加了&lt;span&gt;&lt;/span&gt;标签，并将这部分一并加入到上述HTML代码的最后一个&lt;div&gt;中，如图所示：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="299" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-287.png" alt="" class="wp-image-2122" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-287.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-287-300x88.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-287-768x224.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">CSS样式</h4>



<pre class="wp-block-code"><code>&lt;!-- 页脚样式开始 --&gt;
&lt;style&gt;
.github-badge {
display: inline-block;
border-radius: 4px;
text-shadow: none;
font-size: 13.1px;
color: #fff;
line-height: 15px;
margin-bottom: 5px;
font-family: "Open Sans", sans-serif;
}
.github-badge .badge-subject {
display: inline-block;
background-color: #4d4d4d;
padding: 4px 4px 4px 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
font-family: "Open Sans", sans-serif;
}
.github-badge .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
font-family: "Open Sans", sans-serif;
}
.github-badge-big {
display: inline-block;
border-radius: 6px;
text-shadow: none;
font-size: 14.1px;
color: #fff;
line-height: 18px;
margin-bottom: 7px;
}
.github-badge-big .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-big .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.github-badge-big .badge-time {
display: inline-block;
padding: 4px 4px 4px 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.github-badge-big .badge-theme {
display: inline-block;
padding: 4px 4px 4px 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.bg-orange {
background-color: #ec8a64 !important;
}
.bg-red {
background-color: #cb7574 !important;
}
.bg-apricots {
background-color: #f7c280 !important;
}
.bg-casein {
background-color: #dfe291 !important;
}
.bg-shallots {
background-color: #97c3c6 !important;
}
.bg-ogling {
background-color: #95c7e0 !important;
}
.bg-haze {
background-color: #9aaec7 !important;
}
.bg-mountain-terrier {
background-color: #99a5cd !important;
}
&lt;/style&gt;
&lt;!-- 页脚样式结束 --&gt;</code></pre>



<h4 class="wp-block-heading">JavaScript</h4>



<pre class="wp-block-code"><code>&lt;!-- 网站运行时间模块开始 --&gt;
&lt;script type="text/javascript"&gt;
var blog_running_days = document.getElementById("blog_running_days");
var blog_running_hours = document.getElementById("blog_running_hours");
var blog_running_mins = document.getElementById("blog_running_mins");
var blog_running_secs = document.getElementById("blog_running_secs");
function refresh_blog_running_time() {
	var time = new Date() - new Date(2024, 10, 15, 0, 0, 0); /*此处日期的月份改为自己真正月份的前一个月*/
	var d = parseInt(time / 24 / 60 / 60 / 1000);
	var h = parseInt((time % (24 * 60 * 60 * 1000)) / 60 / 60 / 1000);
	var m = parseInt((time % (60 * 60 * 1000)) / 60 / 1000);
	var s = parseInt((time % (60 * 1000)) / 1000);
	blog_running_days.innerHTML = d;
	blog_running_hours.innerHTML = h;
	blog_running_mins.innerHTML = m;
	blog_running_secs.innerHTML = s;
}
refresh_blog_running_time();
if (typeof bottomTimeIntervalHasSet == "undefined") {
	var bottomTimeIntervalHasSet = true;
	setInterval(function () {
		refresh_blog_running_time();
	}, 500);
}
&lt;/script&gt;
&lt;!-- 网站运行时间模块结束 --&gt;</code></pre>



<p class="wp-block-paragraph">代码有了，那么该怎么加到主题当中呢，一开始我是这么加的：</p>



<ul class="wp-block-list">
<li>HTML：Argon主题选项——页脚</li>



<li>CSS：主题——自定义——额外CSS</li>



<li>JavaScript：WordPress——外观——主题文件编辑器——header.php</li>
</ul>



<p class="wp-block-paragraph">后来看了Bensz大佬的博客<a href="https://blognas.hwb0307.com/linux/docker/744#comment-918" target="_blank" rel="noopener">Docker系列 WordPress系列 特效</a>，受益匪浅。的确，为了避免代码因主题更新等原因而丢失，为了提高代码的逻辑性，也为了我们编写修改代码的可操作性。将一些自定义代码与主题原始代码分开保存是很有必要的。接下来就是大佬的方法。</p>



<p class="wp-block-paragraph">首先将上述代码统一保存到服务器上的WordPress根目录下某个位置，我在wordpress目录下创建了theme-modify目录，用于存放自定义的一些代码。然后将上述三部分代码一并放到一个文件footerinfo.php。</p>



<pre class="wp-block-code"><code>&#91;root@dameng theme-modify]# pwd
/home/wwwroot/wordpress/theme-modify
&#91;root@dameng theme-modify]# ll footerinfo.php 
-rw-r--r-- 1 www www 4475 Nov 27 14:34 footerinfo.php</code></pre>



<p class="wp-block-paragraph">接下来就是如何在主题代码中调用这个文件。因为我们要添加的是页脚网站信息，所以要在主题文件编辑器的footer.php文件中引入，在<code>&lt;footer&gt;&lt;/footer&gt;</code>标签中添加如下代码：</p>



<pre class="wp-block-code"><code>&lt;!--页脚耗时开始--&gt;
&lt;?php require('./theme-modify/footerinfo.php'); ?&gt;
&lt;!--页脚耗时结束--&gt;</code></pre>



<p class="wp-block-paragraph">如图</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="892" height="381" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-288.png" alt="" class="wp-image-2123" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-288.png 892w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-288-300x128.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-288-768x328.png 768w" sizes="auto, (max-width: 892px) 100vw, 892px" /></figure>



<p class="wp-block-paragraph">大功告成，汇总一下这部分代码：</p>



<pre class="wp-block-code"><code>&lt;!-- HTML 开始 --&gt;
&lt;div class="github-badge-big"&gt;
	&lt;span class="badge-subject"&gt;&lt;i class="fa fa-id-card"&gt;&lt;/i&gt; 备案号 &lt;/span&gt;
	&lt;span class="badge-value bg-orange"&gt;
	&lt;!-- 备案链接 --&gt;
	&lt;a href="https://beian.miit.gov.cn/" target="_blank" one-link-mark="yes"&gt;京ICP备1234567890号&lt;/a&gt;|
	&lt;a href="https://www.beian.gov.cn/portal/index?token=e547b70c-fbe1-4c80-a4a2-857b17389a71" target="_blank" one-link-mark="yes"&gt;
	京公安网备 20241111111111号&lt;/a&gt;
	&lt;/span&gt;
&lt;/div&gt;
&lt;div class="github-badge-big"&gt;
	&lt;span class="badge-subject"&gt;&lt;i class="fa fa-cloud" aria-hidden="true"&gt;&lt;/i&gt; CDN&lt;/span&gt;
	&lt;span class="badge-value bg-shallots"&gt;
	&lt;!-- 华为云链接 --&gt;
	&lt;a href="https://www.huaweicloud.com/" target="_blank" one-link-mark="yes"&gt;HUAWEIYUN&lt;/a&gt;
	&lt;/span&gt;

	&lt;span class="badge-subject"&gt;&lt;i class="fa fa-wordpress"&gt;&lt;/i&gt; Powered&lt;/span&gt;
	&lt;span class="badge-value bg-green"&gt;
	&lt;!-- wordpress链接 --&gt;
	&lt;a href="https://cn.wordpress.org/" target="_blank" one-link-mark="yes"&gt;
	WordPress&lt;/a&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div class="github-badge-big"&gt;
	&lt;span class="badge-subject"&gt;&lt;i class="fa fa-copyright" aria-hidden="true"&gt;&lt;/i&gt;Copyright &lt;/span&gt;
	&lt;span class="badge-value bg-red"&gt;2024-2025&lt;/i&gt;
	&lt;a href="https://www.lemonary.cn/" target="_blank" one-link-mark="yes"&gt;@ Shine
	&lt;/span&gt;
&lt;/div&gt;
&lt;!-- 运行时间 --&gt;
&lt;div class="github-badge-big"&gt;
	&lt;span class="badge-subject"&gt;&lt;i class="fa fa-clock-o"&gt;&lt;/i&gt; Running Time&lt;/span&gt;&lt;span
	class="badge-value bg-apricots"&gt;&lt;span id="blog_running_days" class="odometer odometer-auto-theme"&gt;&lt;/span&gt;
	days
	&lt;span id="blog_running_hours" class="odometer odometer-auto-theme"&gt;&lt;/span&gt; H
	&lt;span id="blog_running_mins" class="odometer odometer-auto-theme"&gt;&lt;/span&gt; M
	&lt;span id="blog_running_secs" class="odometer odometer-auto-theme"&gt;&lt;/span&gt;S
	&lt;/span&gt;
&lt;/div&gt;&lt;br&gt;
&lt;div class="github-badge-big"&gt;
&lt;?php printf(' | 耗时 %.3f 秒 | 查询 %d 次 | 内存 %.2f MB |',timer_stop( 0, 3 ),get_num_queries(),memory_get_peak_usage() / 1024 / 1024);?&gt;
&lt;/div&gt;&lt;br&gt;
&lt;!-- HTML 结束--&gt;

&lt;!-- 页脚样式开始 --&gt;
&lt;style&gt;
.github-badge {
display: inline-block;
border-radius: 4px;
text-shadow: none;
font-size: 13.1px;
color: #fff;
line-height: 15px;
margin-bottom: 5px;
font-family: "Open Sans", sans-serif;
}
.github-badge .badge-subject {
display: inline-block;
background-color: #4d4d4d;
padding: 4px 4px 4px 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
font-family: "Open Sans", sans-serif;
}
.github-badge .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
font-family: "Open Sans", sans-serif;
}
.github-badge-big {
display: inline-block;
border-radius: 6px;
text-shadow: none;
font-size: 14.1px;
color: #fff;
line-height: 18px;
margin-bottom: 7px;
}
.github-badge-big .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-big .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.bg-orange {
background-color: #ec8a64 !important;
}
.bg-red {
background-color: #cb7574 !important;
}
.bg-apricots {
background-color: #f7c280 !important;
}
.bg-casein {
background-color: #dfe291 !important;
}
.bg-shallots {
background-color: #97c3c6 !important;
}
.bg-ogling {
background-color: #95c7e0 !important;
}
.bg-haze {
background-color: #9aaec7 !important;
}
.bg-mountain-terrier {
background-color: #99a5cd !important;
}
&lt;/style&gt;
&lt;!-- 页脚样式结束 --&gt;

&lt;!-- 网站运行时间模块开始 --&gt;
&lt;script type="text/javascript"&gt;
var blog_running_days = document.getElementById("blog_running_days");
var blog_running_hours = document.getElementById("blog_running_hours");
var blog_running_mins = document.getElementById("blog_running_mins");
var blog_running_secs = document.getElementById("blog_running_secs");
function refresh_blog_running_time() {
	var time = new Date() - new Date(2024, 10, 15, 0, 0, 0); /*此处日期的月份改为自己真正月份的前一个月*/
	var d = parseInt(time / 24 / 60 / 60 / 1000);
	var h = parseInt((time % (24 * 60 * 60 * 1000)) / 60 / 60 / 1000);
	var m = parseInt((time % (60 * 60 * 1000)) / 60 / 1000);
	var s = parseInt((time % (60 * 1000)) / 1000);
	blog_running_days.innerHTML = d;
	blog_running_hours.innerHTML = h;
	blog_running_mins.innerHTML = m;
	blog_running_secs.innerHTML = s;
}
refresh_blog_running_time();
if (typeof bottomTimeIntervalHasSet == "undefined") {
	var bottomTimeIntervalHasSet = true;
	setInterval(function () {
		refresh_blog_running_time();
	}, 500);
}
&lt;/script&gt;
&lt;!-- 网站运行时间模块结束 --&gt;</code></pre>



<h3 class="wp-block-heading" id="1.7-页脚部分内容抖动效果">1.7 页脚部分内容抖动效果</h3>



<p class="wp-block-paragraph">源代码出自<a href="https://hikami.moe/" target="_blank" rel="noreferrer noopener">希卡米 | HiKami</a>之手，我只是通过Bensz大佬的博客发现而已。<a href="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/css/myface.css" target="_blank" rel="noopener">大佬的CSS抖动代码</a></p>



<p class="wp-block-paragraph">原理：直接将大佬代码中的 my-face 替换成你的页面中想要抖动效果的元素的类名即可。</p>



<p class="wp-block-paragraph"><strong>使用方法</strong></p>



<p class="wp-block-paragraph">创建文件footershake.php，复制代码内容到文件中：</p>



<pre class="wp-block-code"><code>.my-face {
  -webkit-animation: my-face 5s infinite ease-in-out;
          animation: my-face 5s infinite ease-in-out;
  display: inline-block;
  margin: 0 5px;
}

@-webkit-keyframes my-face {
  2%,
  24%,
  80% {
    -webkit-transform: translate(0, 1.5px) rotate(1.5deg);
            transform: translate(0, 1.5px) rotate(1.5deg);
  }
  4%,
  68%,
  98% {
    -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);
            transform: translate(0, -1.5px) rotate(-0.5deg);
  }
  38%,
  6% {
    -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);
            transform: translate(0, 1.5px) rotate(-1.5deg);
  }
  8%,
  86% {
    -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);
            transform: translate(0, -1.5px) rotate(-1.5deg);
  }
  10%,
  72% {
    -webkit-transform: translate(0, 2.5px) rotate(1.5deg);
            transform: translate(0, 2.5px) rotate(1.5deg);
  }
  12%,
  64%,
  78%,
  96% {
    -webkit-transform: translate(0, -0.5px) rotate(1.5deg);
            transform: translate(0, -0.5px) rotate(1.5deg);
  }
  14%,
  54% {
    -webkit-transform: translate(0, -1.5px) rotate(1.5deg);
            transform: translate(0, -1.5px) rotate(1.5deg);
  }
  16% {
    -webkit-transform: translate(0, -0.5px) rotate(-1.5deg);
            transform: translate(0, -0.5px) rotate(-1.5deg);
  }
  18%,
  22% {
    -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);
            transform: translate(0, 0.5px) rotate(-1.5deg);
  }
  20%,
  36%,
  46% {
    -webkit-transform: translate(0, -1.5px) rotate(2.5deg);
            transform: translate(0, -1.5px) rotate(2.5deg);
  }
  26%,
  50% {
    -webkit-transform: translate(0, 0.5px) rotate(0.5deg);
            transform: translate(0, 0.5px) rotate(0.5deg);
  }
  28% {
    -webkit-transform: translate(0, 0.5px) rotate(1.5deg);
            transform: translate(0, 0.5px) rotate(1.5deg);
  }
  30%,
  40%,
  62%,
  76%,
  88% {
    -webkit-transform: translate(0, -0.5px) rotate(2.5deg);
            transform: translate(0, -0.5px) rotate(2.5deg);
  }
  32%,
  34%,
  66% {
    -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);
            transform: translate(0, 1.5px) rotate(-0.5deg);
  }
  42% {
    -webkit-transform: translate(0, 2.5px) rotate(-1.5deg);
            transform: translate(0, 2.5px) rotate(-1.5deg);
  }
  44%,
  70% {
    -webkit-transform: translate(0, 1.5px) rotate(0.5deg);
            transform: translate(0, 1.5px) rotate(0.5deg);
  }
  48%,
  74%,
  82% {
    -webkit-transform: translate(0, -0.5px) rotate(0.5deg);
            transform: translate(0, -0.5px) rotate(0.5deg);
  }
  52%,
  56%,
  60% {
    -webkit-transform: translate(0, 2.5px) rotate(2.5deg);
            transform: translate(0, 2.5px) rotate(2.5deg);
  }
  58% {
    -webkit-transform: translate(0, 0.5px) rotate(2.5deg);
            transform: translate(0, 0.5px) rotate(2.5deg);
  }
  84% {
    -webkit-transform: translate(0, 1.5px) rotate(2.5deg);
            transform: translate(0, 1.5px) rotate(2.5deg);
  }
  90% {
    -webkit-transform: translate(0, 2.5px) rotate(-0.5deg);
            transform: translate(0, 2.5px) rotate(-0.5deg);
  }
  92% {
    -webkit-transform: translate(0, 0.5px) rotate(-0.5deg);
            transform: translate(0, 0.5px) rotate(-0.5deg);
  }
  94% {
    -webkit-transform: translate(0, 2.5px) rotate(0.5deg);
            transform: translate(0, 2.5px) rotate(0.5deg);
  }
  0%,
  100% {
    -webkit-transform: translate(0, 0) rotate(0);
            transform: translate(0, 0) rotate(0);
  }
}

@keyframes my-face {
  2%,
  24%,
  80% {
    -webkit-transform: translate(0, 1.5px) rotate(1.5deg);
            transform: translate(0, 1.5px) rotate(1.5deg);
  }
  4%,
  68%,
  98% {
    -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);
            transform: translate(0, -1.5px) rotate(-0.5deg);
  }
  38%,
  6% {
    -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);
            transform: translate(0, 1.5px) rotate(-1.5deg);
  }
  8%,
  86% {
    -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);
            transform: translate(0, -1.5px) rotate(-1.5deg);
  }
  10%,
  72% {
    -webkit-transform: translate(0, 2.5px) rotate(1.5deg);
            transform: translate(0, 2.5px) rotate(1.5deg);
  }
  12%,
  64%,
  78%,
  96% {
    -webkit-transform: translate(0, -0.5px) rotate(1.5deg);
            transform: translate(0, -0.5px) rotate(1.5deg);
  }
  14%,
  54% {
    -webkit-transform: translate(0, -1.5px) rotate(1.5deg);
            transform: translate(0, -1.5px) rotate(1.5deg);
  }
  16% {
    -webkit-transform: translate(0, -0.5px) rotate(-1.5deg);
            transform: translate(0, -0.5px) rotate(-1.5deg);
  }
  18%,
  22% {
    -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);
            transform: translate(0, 0.5px) rotate(-1.5deg);
  }
  20%,
  36%,
  46% {
    -webkit-transform: translate(0, -1.5px) rotate(2.5deg);
            transform: translate(0, -1.5px) rotate(2.5deg);
  }
  26%,
  50% {
    -webkit-transform: translate(0, 0.5px) rotate(0.5deg);
            transform: translate(0, 0.5px) rotate(0.5deg);
  }
  28% {
    -webkit-transform: translate(0, 0.5px) rotate(1.5deg);
            transform: translate(0, 0.5px) rotate(1.5deg);
  }
  30%,
  40%,
  62%,
  76%,
  88% {
    -webkit-transform: translate(0, -0.5px) rotate(2.5deg);
            transform: translate(0, -0.5px) rotate(2.5deg);
  }
  32%,
  34%,
  66% {
    -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);
            transform: translate(0, 1.5px) rotate(-0.5deg);
  }
  42% {
    -webkit-transform: translate(0, 2.5px) rotate(-1.5deg);
            transform: translate(0, 2.5px) rotate(-1.5deg);
  }
  44%,
  70% {
    -webkit-transform: translate(0, 1.5px) rotate(0.5deg);
            transform: translate(0, 1.5px) rotate(0.5deg);
  }
  48%,
  74%,
  82% {
    -webkit-transform: translate(0, -0.5px) rotate(0.5deg);
            transform: translate(0, -0.5px) rotate(0.5deg);
  }
  52%,
  56%,
  60% {
    -webkit-transform: translate(0, 2.5px) rotate(2.5deg);
            transform: translate(0, 2.5px) rotate(2.5deg);
  }
  58% {
    -webkit-transform: translate(0, 0.5px) rotate(2.5deg);
            transform: translate(0, 0.5px) rotate(2.5deg);
  }
  84% {
    -webkit-transform: translate(0, 1.5px) rotate(2.5deg);
            transform: translate(0, 1.5px) rotate(2.5deg);
  }
  90% {
    -webkit-transform: translate(0, 2.5px) rotate(-0.5deg);
            transform: translate(0, 2.5px) rotate(-0.5deg);
  }
  92% {
    -webkit-transform: translate(0, 0.5px) rotate(-0.5deg);
            transform: translate(0, 0.5px) rotate(-0.5deg);
  }
  94% {
    -webkit-transform: translate(0, 2.5px) rotate(0.5deg);
            transform: translate(0, 2.5px) rotate(0.5deg);
  }
  0%,
  100% {
    -webkit-transform: translate(0, 0) rotate(0);
            transform: translate(0, 0) rotate(0);
  }
}</code></pre>



<p class="wp-block-paragraph">我页面中抖动的元素类名是<code>badge-subject</code>，所以将上述文件中的<code>my-face</code>全部替换成<code>badge-subject</code>，代码如下：</p>



<pre class="wp-block-code"><code>&lt;!-- 页脚文字抖动效果 开始 --&gt;
&lt;style&gt;
.badge-subject {
  -webkit-animation: badge-subject 5s infinite ease-in-out;
          animation: badge-subject 5s infinite ease-in-out;
  display: inline-block;
  margin: 0 5px;
}

@-webkit-keyframes badge-subject {
  2%,
  24%,
  80% {
    -webkit-transform: translate(0, 1.5px) rotate(1.5deg);
            transform: translate(0, 1.5px) rotate(1.5deg);
  }
  4%,
  68%,
  98% {
    -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);
            transform: translate(0, -1.5px) rotate(-0.5deg);
  }
  38%,
  6% {
    -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);
            transform: translate(0, 1.5px) rotate(-1.5deg);
  }
  8%,
  86% {
    -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);
            transform: translate(0, -1.5px) rotate(-1.5deg);
  }
  10%,
  72% {
    -webkit-transform: translate(0, 2.5px) rotate(1.5deg);
            transform: translate(0, 2.5px) rotate(1.5deg);
  }
  12%,
  64%,
  78%,
  96% {
    -webkit-transform: translate(0, -0.5px) rotate(1.5deg);
            transform: translate(0, -0.5px) rotate(1.5deg);
  }
  14%,
  54% {
    -webkit-transform: translate(0, -1.5px) rotate(1.5deg);
            transform: translate(0, -1.5px) rotate(1.5deg);
  }
  16% {
    -webkit-transform: translate(0, -0.5px) rotate(-1.5deg);
            transform: translate(0, -0.5px) rotate(-1.5deg);
  }
  18%,
  22% {
    -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);
            transform: translate(0, 0.5px) rotate(-1.5deg);
  }
  20%,
  36%,
  46% {
    -webkit-transform: translate(0, -1.5px) rotate(2.5deg);
            transform: translate(0, -1.5px) rotate(2.5deg);
  }
  26%,
  50% {
    -webkit-transform: translate(0, 0.5px) rotate(0.5deg);
            transform: translate(0, 0.5px) rotate(0.5deg);
  }
  28% {
    -webkit-transform: translate(0, 0.5px) rotate(1.5deg);
            transform: translate(0, 0.5px) rotate(1.5deg);
  }
  30%,
  40%,
  62%,
  76%,
  88% {
    -webkit-transform: translate(0, -0.5px) rotate(2.5deg);
            transform: translate(0, -0.5px) rotate(2.5deg);
  }
  32%,
  34%,
  66% {
    -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);
            transform: translate(0, 1.5px) rotate(-0.5deg);
  }
  42% {
    -webkit-transform: translate(0, 2.5px) rotate(-1.5deg);
            transform: translate(0, 2.5px) rotate(-1.5deg);
  }
  44%,
  70% {
    -webkit-transform: translate(0, 1.5px) rotate(0.5deg);
            transform: translate(0, 1.5px) rotate(0.5deg);
  }
  48%,
  74%,
  82% {
    -webkit-transform: translate(0, -0.5px) rotate(0.5deg);
            transform: translate(0, -0.5px) rotate(0.5deg);
  }
  52%,
  56%,
  60% {
    -webkit-transform: translate(0, 2.5px) rotate(2.5deg);
            transform: translate(0, 2.5px) rotate(2.5deg);
  }
  58% {
    -webkit-transform: translate(0, 0.5px) rotate(2.5deg);
            transform: translate(0, 0.5px) rotate(2.5deg);
  }
  84% {
    -webkit-transform: translate(0, 1.5px) rotate(2.5deg);
            transform: translate(0, 1.5px) rotate(2.5deg);
  }
  90% {
    -webkit-transform: translate(0, 2.5px) rotate(-0.5deg);
            transform: translate(0, 2.5px) rotate(-0.5deg);
  }
  92% {
    -webkit-transform: translate(0, 0.5px) rotate(-0.5deg);
            transform: translate(0, 0.5px) rotate(-0.5deg);
  }
  94% {
    -webkit-transform: translate(0, 2.5px) rotate(0.5deg);
            transform: translate(0, 2.5px) rotate(0.5deg);
  }
  0%,
  100% {
    -webkit-transform: translate(0, 0) rotate(0);
            transform: translate(0, 0) rotate(0);
  }
}

@keyframes badge-subject {
  2%,
  24%,
  80% {
    -webkit-transform: translate(0, 1.5px) rotate(1.5deg);
            transform: translate(0, 1.5px) rotate(1.5deg);
  }
  4%,
  68%,
  98% {
    -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);
            transform: translate(0, -1.5px) rotate(-0.5deg);
  }
  38%,
  6% {
    -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);
            transform: translate(0, 1.5px) rotate(-1.5deg);
  }
  8%,
  86% {
    -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);
            transform: translate(0, -1.5px) rotate(-1.5deg);
  }
  10%,
  72% {
    -webkit-transform: translate(0, 2.5px) rotate(1.5deg);
            transform: translate(0, 2.5px) rotate(1.5deg);
  }
  12%,
  64%,
  78%,
  96% {
    -webkit-transform: translate(0, -0.5px) rotate(1.5deg);
            transform: translate(0, -0.5px) rotate(1.5deg);
  }
  14%,
  54% {
    -webkit-transform: translate(0, -1.5px) rotate(1.5deg);
            transform: translate(0, -1.5px) rotate(1.5deg);
  }
  16% {
    -webkit-transform: translate(0, -0.5px) rotate(-1.5deg);
            transform: translate(0, -0.5px) rotate(-1.5deg);
  }
  18%,
  22% {
    -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);
            transform: translate(0, 0.5px) rotate(-1.5deg);
  }
  20%,
  36%,
  46% {
    -webkit-transform: translate(0, -1.5px) rotate(2.5deg);
            transform: translate(0, -1.5px) rotate(2.5deg);
  }
  26%,
  50% {
    -webkit-transform: translate(0, 0.5px) rotate(0.5deg);
            transform: translate(0, 0.5px) rotate(0.5deg);
  }
  28% {
    -webkit-transform: translate(0, 0.5px) rotate(1.5deg);
            transform: translate(0, 0.5px) rotate(1.5deg);
  }
  30%,
  40%,
  62%,
  76%,
  88% {
    -webkit-transform: translate(0, -0.5px) rotate(2.5deg);
            transform: translate(0, -0.5px) rotate(2.5deg);
  }
  32%,
  34%,
  66% {
    -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);
            transform: translate(0, 1.5px) rotate(-0.5deg);
  }
  42% {
    -webkit-transform: translate(0, 2.5px) rotate(-1.5deg);
            transform: translate(0, 2.5px) rotate(-1.5deg);
  }
  44%,
  70% {
    -webkit-transform: translate(0, 1.5px) rotate(0.5deg);
            transform: translate(0, 1.5px) rotate(0.5deg);
  }
  48%,
  74%,
  82% {
    -webkit-transform: translate(0, -0.5px) rotate(0.5deg);
            transform: translate(0, -0.5px) rotate(0.5deg);
  }
  52%,
  56%,
  60% {
    -webkit-transform: translate(0, 2.5px) rotate(2.5deg);
            transform: translate(0, 2.5px) rotate(2.5deg);
  }
  58% {
    -webkit-transform: translate(0, 0.5px) rotate(2.5deg);
            transform: translate(0, 0.5px) rotate(2.5deg);
  }
  84% {
    -webkit-transform: translate(0, 1.5px) rotate(2.5deg);
            transform: translate(0, 1.5px) rotate(2.5deg);
  }
  90% {
    -webkit-transform: translate(0, 2.5px) rotate(-0.5deg);
            transform: translate(0, 2.5px) rotate(-0.5deg);
  }
  92% {
    -webkit-transform: translate(0, 0.5px) rotate(-0.5deg);
            transform: translate(0, 0.5px) rotate(-0.5deg);
  }
  94% {
    -webkit-transform: translate(0, 2.5px) rotate(0.5deg);
            transform: translate(0, 2.5px) rotate(0.5deg);
  }
  0%,
  100% {
    -webkit-transform: translate(0, 0) rotate(0);
            transform: translate(0, 0) rotate(0);
  }
}
&lt;/style&gt;
&lt;!-- 页脚文字抖动效果 结束 --&gt;</code></pre>



<p class="wp-block-paragraph">代码引入：主题文件编辑器的footer.php，在标签<code>&lt;footer&gt;&lt;/footer&gt;</code>中添加：</p>



<pre class="wp-block-code"><code>&lt;!-- 页脚耗时开始 --&gt;
&lt;?php require('./theme-modify/footershake.php'); ?&gt;
&lt;!-- 页脚耗时结束 --&gt;</code></pre>



<h3 class="wp-block-heading" id="1.8-网页特效">1.8 网页特效</h3>



<p class="wp-block-paragraph">页面特效+鼠标特效+文字输入特效+网页标题特效</p>



<p class="wp-block-paragraph">这部分JavaScript文件源自于<a href="https://github.com/hgoebl/mobile-detect.js#readme" target="_blank" rel="noreferrer noopener">mobile-detect</a>项目和<a href="https://blognas.hwb0307.com/linux/docker/744" target="_blank" rel="noopener">Bensz大佬的博客</a>，下载如下文件：</p>



<pre class="wp-block-code"><code>//全页特效
https:&#47;&#47;cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/mobile-detect.js
//雪花
https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/xiaxue.js
//樱花
https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/yinghua.js
//小烟花
https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/mouse-click.js
//大烟花
https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/mouse-click-02/mouse-canvas.js
//鼠标仙女棒
https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/halo-dream/fairyDustCursor.min.js
//鼠标吹泡泡https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/joe/censor10.js
//文字输入撒花
https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/input-with-fire.js
//网页标题文字
https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/onfocus.js</code></pre>



<p class="wp-block-paragraph">在服务器的WordPress根目录下创建effects目录，将上述JavaScript文件上传到该目录下。</p>



<p class="wp-block-paragraph">再到theme-modify目录下创建文件effects.php，编辑如下代码：</p>



<pre class="wp-block-code"><code>&lt;!-- 全页特效 开始 --&gt;
&lt;script src="/effects/mobile-detect.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
	// 设备检测
	var md = new MobileDetect(window.navigator.userAgent);

	// PC生效，手机/平板不生效
	// md.mobile(); md.phone(); 
	if(!md.phone()){
		if(!md.tablet()){
			// 雪花
			//$.getScript("/effects/xiaxue.js");

			// 樱花
			// $.getScript("/effects/yinghua.js");

			// 小烟花特效
			// $.getScript("/effects/mouse-click.js");

			// 大烟花特效
			//$.getScript("/effects/mouse-canvas.js");
			//document.write('&lt;style&gt;#mouse-canvas {z-index:217483647; pointer-events: none;  box-sizing: border-box !important; display: block !important; position: fixed !important; left: 0; right: 0; top: 0; bottom: 0; width: 100%; height: 100vh;}&lt;/style&gt;')

			//鼠标移动的仙女棒特效
			$.getScript("/effects/fairyDustCursor.min.js");

			// 鼠标移动的泡泡特效
			// $.getScript("/effects/censor10.js");
		}
	}
&lt;/script&gt;
&lt;!-- 网站输入效果 开始 --&gt;
&lt;script src="/effects/input-with-fire.js"&gt;&lt;/script&gt;
&lt;!-- 网站输入效果 结束 --&gt;
&lt;!-- 网站标题搞笑字符 开始 --&gt;
&lt;script src="/effects/onfocus.js"&gt;&lt;/script&gt;
&lt;!-- 网站标题搞笑字符 结束 --&gt;
&lt;!-- 全页特效 结束 --&gt;</code></pre>



<p class="wp-block-paragraph">代码引入：主题代码编辑器的footer.php中：在末尾<code>&lt;/body&gt;</code>上方添加：</p>



<pre class="wp-block-code"><code>&lt;!-- 全页特效 开始 --&gt;
&lt;?php require('./theme-modify/effects.php'); ?&gt;
&lt;!-- 全页特效 结束 --&gt;</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">目前标题搞笑字符已取消。</p>
</blockquote>



<h3 class="wp-block-heading" id="1.9-点击概要也可以进入文章">1.9 点击概要进入文章</h3>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">注意：此bug由<a href="https://buasis.eu.org/" target="_blank" rel="noreferrer noopener">Ksable</a>修复，万分感谢！</p>
</blockquote>



<p class="wp-block-paragraph">Argon主题默认情况下，文章只能通过点击标题进入。按这个设置修改以后，点击概要也可以进入文章。</p>



<p class="wp-block-paragraph">在主题文件编辑器中找到content-preview-1.php文件，在post-content元素中添加如下属性后保存文件：</p>



<pre class="wp-block-code"><code>onclick="pjaxNavigate('&lt;?php the_permalink(); ?&gt;')" style="cursor: pointer"</code></pre>



<p class="wp-block-paragraph">如下图所示：</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="587" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-289.png" alt="" class="wp-image-2124" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-289.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-289-300x172.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-289-768x440.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">pjaxNavigate函数的作用是为了保持Pjax效果，即点击链接的时候不会自动刷新页面。我们通过JavaScript定义pjaxNavigate函数来调用pjax。创建文件article-abstract.php，编辑如下代码：</p>
</blockquote>



<pre class="wp-block-code"><code>// 使用 PJAX 进行页面跳转，
function pjaxNavigate(url) {
    $.pjax({
      url: url,       // 要跳转的页面 URL
    });
}</code></pre>



<p class="wp-block-paragraph">代码引入：主题代码编辑器的footer.php中：在末尾<code>&lt;/body&gt;</code>上方添加：</p>



<pre class="wp-block-code"><code>&lt;!-- 文章摘要可点击 开始 --&gt;
&lt;?php require('./theme-modify/article-abstract.php'); ?&gt;
&lt;!-- 文章摘要可点击 结束 --&gt;</code></pre>



<h3 class="wp-block-heading" id="1.10-悼念色">1.10 悼念色</h3>



<p class="wp-block-paragraph">遇到国家重要人物逝世、抗战纪念日等重大时点，为了表示悲悼，很多网站会选择全黑白的配色。</p>



<p class="wp-block-paragraph">只需要在<strong>额外CSS的最底部</strong>（否则容易和其它CSS代码冲突）添加下列代码即可：</p>



<pre class="wp-block-code"><code>/*网站黑白色（悼念）*/
html {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: url("data:image/svg+xml;utf8,#grayscale");
    filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
    -webkit-filter: grayscale(1);
}</code></pre>



<p class="wp-block-paragraph">该CSS代码对于任何WordPress主题都是适用的。</p>



<h3 class="wp-block-heading" id="1.11-左下角看板娘">1.11 左下角看板娘</h3>



<p class="wp-block-paragraph">此部分代码可见单独的博客：<a href="https://lemonary.cn/live2d-%e5%8d%9a%e5%ae%a2%e5%ae%a0%e7%89%a9/" target="_blank" rel="noopener">Live2D 博客宠物</a>。</p>



<h3 class="wp-block-heading">1.12 春节快乐灯笼</h3>



<p class="wp-block-paragraph">这部分css代码源自大佬Bensz：<a href="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/css/deng.css" target="_blank" rel="noopener">https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/css/deng.css</a></p>



<p class="wp-block-paragraph">同样我是将css内容写到我的effects目录下，新建文件chunjie.css。然后通过先前的theme-modify/effect.php文件引入，代码如下：</p>



<pre class="wp-block-code"><code>document.write('&lt;link href="/effects/chunjie.css" rel="stylesheet"&gt;');
document.write('&lt;div class="deng-box"&gt;&lt;div class="deng"&gt;&lt;div class="xian"&gt;&lt;/div&gt;&lt;div class="deng-a"&gt;&lt;div class="deng-b"&gt;&lt;div class="deng-t"&gt;春节&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="shui shui-a"&gt;&lt;div class="shui-c"&gt;&lt;/div&gt;&lt;div class="shui-b"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;');
document.write('&lt;div class="deng-box1"&gt;&lt;div class="deng"&gt;&lt;div class="xian"&gt;&lt;/div&gt;&lt;div class="deng-a"&gt;&lt;div class="deng-b"&gt;&lt;div class="deng-t"&gt;快乐&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="shui shui-a"&gt;&lt;div class="shui-c"&gt;&lt;/div&gt;&lt;div class="shui-b"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;');</code></pre>



<p class="wp-block-paragraph">如图</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="415" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-190-1024x415.png" alt="" class="wp-image-1390" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-190-1024x415.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-190-300x122.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-190-768x311.png 768w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-190-1536x622.png 1536w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-190-2048x830.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">定时注释</h4>



<p class="wp-block-paragraph">例如最近新增的春节快乐灯笼装饰，假定我需要在正月十五到正月十六的凌晨去定时取消，那么就需要使用到定时注释的功能，那么要怎么来实现呢？实现方法如下：</p>



<pre class="wp-block-code"><code>0 0 * * *		sed -i '32,34s/^/\/\//' /home/wwwroot/wordpress/theme-modify/effects.php</code></pre>



<p class="wp-block-paragraph">将上方代码添加到crontab定时任务即可在13日凌晨00:00分准时关闭春节快乐灯笼装饰。</p>



<ul class="wp-block-list">
<li><code>0 0 * * *</code>：00:00执行，我是在12日进行的配置，执行后13日再将这部分定时任务关闭。
<ul class="wp-block-list">
<li>当然你可以直接使用<code>0 0 13 2 *</code>来定位到2月13日这一天，那么你可以下一年再来修改这个日期即可。</li>
</ul>
</li>



<li>-i：直接修改文件</li>



<li>32,34：操作第32~34行</li>



<li>s/^/\/\//：在行首插入&nbsp;//（需转义为&nbsp;\/\/）</li>
</ul>



<h3 class="wp-block-heading">1.13 <strong>Font Awesome</strong>图标</h3>



<p class="wp-block-paragraph">Argon主题默认支持Font Awesome图标，但是由于主题已停止更新，仅支持4。所以在引用了5和6两个版本的图标后可能会出现图标无法显示的问题，另外我还碰到了因为Argon主题PJAX无刷新加载技术导致图标没有正常显示的问题：首次加载界面可以显示，但是点击界面中的某些跳转（例如网站顶栏的标题）后图标显示失败。后通过直接引入js的方法解决，如下：</p>



<pre class="wp-block-code"><code>&lt;!-- 新图标fontawesome6模块开始 -->
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/js/all.min.js">&lt;/script>
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/js/v4-shims.min.js">&lt;/script>
&lt;!-- 新图标fontawesome6模块结束 --></code></pre>



<p class="wp-block-paragraph">将上述代码添加到footerinfo.php中即可。</p>



<h3 class="wp-block-heading">特别提醒</h3>



<p class="wp-block-paragraph">很多脚本的引入都是从footer.php的最后添加的，这样可以最后加载，以免影响其他内容的访问速度。</p>



<h2 class="wp-block-heading" id="二、特别鸣谢">二、特别鸣谢</h2>



<p class="wp-block-paragraph">上述修改内容大体是借鉴了以下大佬的博客【简直就是照搬照抄】再此特别感谢各位大佬提供的模板。</p>



<ul class="wp-block-list">
<li><a href="https://crowya.com" target="_blank" rel="noopener">鸦鸦的巢穴</a>【主题页眉、大部分CSS】</li>



<li><a href="https://blognas.hwb0307.com" target="_blank" rel="noopener">Bensz &#8211; 苯苯</a>【大部分页面特效以及代码整理方法】</li>



<li><a href="https://www.liveout.cn/" target="_blank" rel="noopener">Echo小窝</a>【底部音乐播放器、页脚】</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lemonary.cn/argon%e4%b8%bb%e9%a2%98%e4%bb%a3%e7%a0%81%e4%bf%ae%e6%94%b9%e8%ae%b0%e5%bd%95/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
