<?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>PHP &#8211; 良的世界</title>
	<atom:link href="https://www.lemonary.cn/tag/php/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>PHP &#8211; 良的世界</title>
	<link>https://www.lemonary.cn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>记录本站php由版本8.0.30升级到8.3.7</title>
		<link>https://www.lemonary.cn/%e8%ae%b0%e5%bd%95%e6%9c%ac%e7%ab%99php%e7%94%b1%e7%89%88%e6%9c%ac8-0-30%e5%8d%87%e7%ba%a7%e5%88%b08-3-7/</link>
					<comments>https://www.lemonary.cn/%e8%ae%b0%e5%bd%95%e6%9c%ac%e7%ab%99php%e7%94%b1%e7%89%88%e6%9c%ac8-0-30%e5%8d%87%e7%ba%a7%e5%88%b08-3-7/#respond</comments>
		
		<dc:creator><![CDATA[shine]]></dc:creator>
		<pubDate>Wed, 27 Aug 2025 06:56:08 +0000</pubDate>
				<category><![CDATA[建站记录]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php-fpm]]></category>
		<guid isPermaLink="false">https://www.lemonary.cn/?p=2338</guid>

					<description><![CDATA[一、问题背景 由于WordPress升级到6.8.2版本以来一直提示php版本太旧，建议升级到8.3及更高的版 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">一、问题背景</h2>



<p class="wp-block-paragraph">由于WordPress升级到6.8.2版本以来一直提示php版本太旧，建议升级到8.3及更高的版本，本着强迫症的原则，已于今天上午将本站的php升级到版本8.3.7，现记录本文。看完本文如果你有更好更简单的升级方法可以在评论区留言，大家一起探讨。</p>



<h2 class="wp-block-heading">二、操作步骤</h2>



<h3 class="wp-block-heading">（1）lnmp脚本安装新版php</h3>



<pre class="wp-block-code"><code>&#91;root@lemonary lnmp2.2]# ./install.sh mphp

+------------------------------------------------------------------------+
|          LNMP V2.1 for Rocky Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|        A tool to auto-compile &amp; install LNMP/LNMPA/LAMP on Linux       |
+------------------------------------------------------------------------+
|           For more information please visit https://lnmp.org           |
+------------------------------------------------------------------------+
===========================
You have 9 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.45
4: Install PHP 5.5.38
5: Install PHP 5.6.40
6: Install PHP 7.0.33
7: Install PHP 7.1.33
8: Install PHP 7.2.34
9: Install PHP 7.3.33
10: Install PHP 7.4.33
11: Install PHP 8.0.30
12: Install PHP 8.1.28
13: Install PHP 8.2.19
14: Install PHP 8.3.7
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 or 14): 14</code></pre>



<p class="wp-block-paragraph">选择14开始安装即可。</p>



<p class="wp-block-paragraph">安装完成后服务器上同时启动着两个版本的php，此时将两版本php全部停止</p>



<pre class="wp-block-code"><code>systemctl stop php-fpm
pkill php-fpm</code></pre>



<p class="wp-block-paragraph">两个版本的路径：</p>



<pre class="wp-block-code"><code>旧：/usr/local/php
新：/usr/local/php8.3</code></pre>



<h3 class="wp-block-heading">（2）保险起见，做下备份</h3>



<pre class="wp-block-code"><code>备份 PHP 配置文件
cp /usr/local/php/etc/php.ini /usr/local/php/etc/php.ini.bak
cp /usr/local/php8.3/etc/php.ini /usr/local/php8.3/etc/php.ini.bak.original
备份 PHP-FPM 配置（如果有用到）
cp /usr/local/php/etc/php-fpm.conf /usr/local/php/etc/php-fpm.conf.bak
cp /usr/local/php/etc/php-fpm.d/www.conf /usr/local/php/etc/php-fpm.d/www.conf.bak</code></pre>



<h3 class="wp-block-heading">（3）检查并配置 PHP-FPM</h3>



<pre class="wp-block-code"><code>grep -n '^listen' /usr/local/php/etc/php-fpm.conf
grep -n '^listen' /usr/local/php8.3/etc/php-fpm.conf</code></pre>



<p class="wp-block-paragraph">确保新版本的&nbsp;<code>listen</code>&nbsp;设置和旧版本<strong>完全一致</strong>（例如&nbsp;<code>listen = /tmp/php-cgi.sock</code>），这样 Nginx 才不需要做任何改动。</p>



<h3 class="wp-block-heading">（4）替换二进制文件与链接（<strong>关键</strong>）</h3>



<p class="wp-block-paragraph">这是将系统默认&nbsp;<code>php</code>&nbsp;和&nbsp;<code>php-fpm</code>&nbsp;命令指向新版本的核心步骤。</p>



<pre class="wp-block-code"><code>备份旧版本的 PHP 目录
mv /usr/local/php /usr/local/php_8.0.30_bak

创建新版本的软链接
ln -sf /usr/local/php8.3 /usr/local/php

验证链接和版本
ls -l /usr/local/php
/usr/local/php/bin/php -v</code></pre>



<p class="wp-block-paragraph">现在，<code>/usr/local/php</code>&nbsp;这个路径就不再指向旧版本，而是指向了&nbsp;<code>/usr/local/php8.3</code>。你的所有现有脚本（如 Nginx 配置、开机启动脚本等）如果引用了&nbsp;<code>/usr/local/php/</code>，现在都会自动使用新版本。</p>



<h3 class="wp-block-heading">（5）启动新版本的 PHP-FPM 服务</h3>



<pre class="wp-block-code"><code>/usr/local/php/sbin/php-fpm
或者
systemctl start php-fpm</code></pre>



<h3 class="wp-block-heading">（6）验证新服务是否正常运行</h3>



<pre class="wp-block-code"><code>ps aux | grep php-fpm
ls -l /tmp/php-cgi.sock # 请替换为你配置中实际的 socket 路径</code></pre>



<h3 class="wp-block-heading">（7）配置 Nginx 并重启（如果需要）</h3>



<p class="wp-block-paragraph"><strong>通常情况下，如果你的 PHP-FPM&nbsp;<code>listen</code>&nbsp;配置没有改变，Nginx 是无需任何修改的。</strong>&nbsp;但最好检查一下 Nginx 的配置文件，确认&nbsp;<code>fastcgi_pass</code>&nbsp;参数指向的 socket 地址是否正确。</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">注意：<br>因为我在新版php-fpm.conf中将<code>listen</code>修改成<code>/tmp/php-cgi8.3.sock</code>（原本为<code>/tmp/php-cgi.sock</code>），所以此处Nginx需要修改配置文件如下位置。</p>
</blockquote>



<p class="wp-block-paragraph">修改<code>/usr/local/nginx/conf/enable-php.conf</code>文件中的<code>fastcgi_pass</code>如下：</p>



<pre class="wp-block-code"><code>fastcgi_pass  unix:/tmp/php-cgi8.3.sock;</code></pre>



<p class="wp-block-paragraph">改成对应php-fpm.conf中配置的listen。</p>



<p class="wp-block-paragraph">为什么要修改这里呢？因为这个文件在nginx.conf配置文件中通过include引入，如下：</p>



<pre class="wp-block-code"><code>grep "include" /usr/local/nginx/conf/nginx.conf
include enable-php.conf;</code></pre>



<p class="wp-block-paragraph">检查配置并重启 Nginx：</p>



<pre class="wp-block-code"><code>nginx -t
nginx -s reload</code></pre>



<h2 class="wp-block-heading">三、其它问题</h2>



<p class="wp-block-paragraph">由于原版的php曾经手动添加过模块exif和Imagick，详见<a href="https://www.lemonary.cn/wordpress%e7%ab%99%e7%82%b9%e5%81%a5%e5%ba%b7%e4%b9%8bphp%e6%a8%a1%e7%bb%84exif%e5%92%8cimagick/">WordPress站点健康之PHP模组Exif和Imagick</a>，所以升级到新版后WordPress还会再次提示缺少这两个模块，而且这次新增一个模块Opcache。这次我们不再手动安装而是直接用lnmp中的脚本进行安装，特别简单。</p>



<pre class="wp-block-code"><code>cd lnmp2.2/
先后执行这两条命令即可
./addons.sh install exif
./addons.sh install imagemagick
./addons.sh install opcache</code></pre>



<p class="wp-block-paragraph">执行结束后重启php-fpm</p>



<pre class="wp-block-code"><code>systemctl restart php-fpm</code></pre>



<p class="wp-block-paragraph">查看验证是否安装成功</p>



<pre class="wp-block-code"><code>&#91;root@lemonary ~]# php -m | grep -E 'exif|imagick|OPcache'
exif
imagick
Zend OPcache
Zend OPcache</code></pre>



<p class="wp-block-paragraph">至此，php版本升级完成。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lemonary.cn/%e8%ae%b0%e5%bd%95%e6%9c%ac%e7%ab%99php%e7%94%b1%e7%89%88%e6%9c%ac8-0-30%e5%8d%87%e7%ba%a7%e5%88%b08-3-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress站点健康之PHP模组Exif和Imagick</title>
		<link>https://www.lemonary.cn/wordpress%e7%ab%99%e7%82%b9%e5%81%a5%e5%ba%b7%e4%b9%8bphp%e6%a8%a1%e7%bb%84exif%e5%92%8cimagick/</link>
					<comments>https://www.lemonary.cn/wordpress%e7%ab%99%e7%82%b9%e5%81%a5%e5%ba%b7%e4%b9%8bphp%e6%a8%a1%e7%bb%84exif%e5%92%8cimagick/#respond</comments>
		
		<dc:creator><![CDATA[shine]]></dc:creator>
		<pubDate>Thu, 21 Nov 2024 08:55:45 +0000</pubDate>
				<category><![CDATA[建站记录]]></category>
		<category><![CDATA[exif]]></category>
		<category><![CDATA[imagick]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://lemonary.cn/?p=375</guid>

					<description><![CDATA[一、问题背景 在 WordPress 配置界面的工具中的站点健康检查出现“缺少一个或多个推荐的模组”，以及“可 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="一、问题背景">一、问题背景</h2>



<p class="wp-block-paragraph">在 WordPress 配置界面的工具中的站点健康检查出现“缺少一个或多个推荐的模组”，以及“可选的模组exif未被安装或已被禁用”和“可选的模组imagick未被安装或已被禁用”。</p>



<h2 class="wp-block-heading" id="二、Exif和Imagick是什么">二、Exif和Imagick是什么</h2>



<p class="wp-block-paragraph">由于我没有学过PHP，不太了解这两个模组有什么具体的功能。感兴趣的可以详细去了解一下。</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Exif<br><a href="https://blog.csdn.net/gitblog_00991/article/details/143556269">https://blog.csdn.net/gitblog_00991/article/details/143556269</a><br>Imagick<br><a href="https://blog.csdn.net/gitblog_00047/article/details/139057418">https://blog.csdn.net/gitblog_00047/article/details/139057418</a></p>
</blockquote>



<h2 class="wp-block-heading" id="三、安装配置">三、安装配置</h2>



<h3 class="wp-block-heading" id="3.1-exif">3.1 exif</h3>



<p class="wp-block-paragraph">由于我的PHP是通过源码安装的，所以我在我的源码包中找到了exif的文件夹，就省去了源码下载的过程。</p>



<p class="wp-block-paragraph">将模组文件夹<code>exif/</code>拷贝到PHP的ext目录【extend】，我的目录是</p>



<pre class="wp-block-code"><code>/usr/local/php/include/php/ext
# 找不到的话，可以用find命令搜索一下
find / -name "ext"</code></pre>



<p class="wp-block-paragraph">进入到exif目录，没有configure文件的话，执行phpize</p>



<pre class="wp-block-code"><code>/usr/local/php/bin/phpize</code></pre>



<p class="wp-block-paragraph">源码安装三部曲</p>



<pre class="wp-block-code"><code>./configure --with-php-config=/usr/local/php/bin/php-config
make
make install</code></pre>



<p class="wp-block-paragraph">其中<code>/usr/local/php/bin/php-config</code>需要根据自己的环境修改，同理找不到的可以搜索一下。</p>



<p class="wp-block-paragraph">三部曲执行完成后会在exif目录下的modules目录中生成exif.so文件，将它拷贝到ext目录下。</p>



<h3 class="wp-block-heading" id="3.2-imagick">3.2 imagick</h3>



<p class="wp-block-paragraph">由于我的PHP源码包中没有找到imagick的包，只能从网上拉取。</p>



<pre class="wp-block-code"><code>wget https://pecl.php.net/get/imagick-3.7.0.tgz</code></pre>



<p class="wp-block-paragraph">源码包解压</p>



<pre class="wp-block-code"><code>tar -zxvf imagick-3.7.0.tgz</code></pre>



<p class="wp-block-paragraph">同样进入到imagick目录</p>



<pre class="wp-block-code"><code>cd imagick-3.7.0</code></pre>



<p class="wp-block-paragraph">如果目录中没有./configure文件，那么可以执行phpize</p>



<pre class="wp-block-code"><code>/usr/local/php/bin/phpize</code></pre>



<p class="wp-block-paragraph">执行完，configure文件就出现了</p>



<p class="wp-block-paragraph">源码安装三部曲，此时会发现<code>./configure --with-php-config=/usr/local/php/bin/php-config</code>会报错：</p>



<pre class="wp-block-code"><code>checking ImageMagick MagickWand API configuration program... 
checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.</code></pre>



<p class="wp-block-paragraph">原因是PHP的模组依附于ImageMagick而生效，而服务器中并没有安装ImageMagick。故而，需要进行安装。可惜的是我的服务器使用源安装<code>yum install -y ImageMagick-devel</code>并没有找到包，所以还是用源码安装的方式。</p>



<pre class="wp-block-code"><code>wget https://imagemagick.org/archive/ImageMagick.tar.gz</code></pre>



<p class="wp-block-paragraph">解压源码包</p>



<pre class="wp-block-code"><code>tar -zxvf ImageMagick.tar.gz</code></pre>



<p class="wp-block-paragraph">再次进入目录</p>



<pre class="wp-block-code"><code>cd ImageMagick-7.1.1-41/</code></pre>



<p class="wp-block-paragraph">源码安装三部曲</p>



<pre class="wp-block-code"><code>./configure
make
make install</code></pre>



<p class="wp-block-paragraph">ImageMagick安装完毕后，再回过头来，重新安装imagick，便可成功。</p>



<p class="wp-block-paragraph">安装成功后同样会在imagick-3.7.0目录下的modules中生成imagick.so文件，将它拷贝到ext目录下。</p>



<h3 class="wp-block-heading" id="3.3-配置PHP">3.3 配置PHP</h3>



<p class="wp-block-paragraph">编辑<code>php.ini</code>文件，我的路径是<code>/usr/local/php/etc/php.ini</code>，同理找不到的可以搜索一下。</p>



<pre class="wp-block-code"><code>extension_dir = "/usr/local/php/include/php/ext/"
extension=exif.so
extension=imagick.so</code></pre>



<p class="wp-block-paragraph">保存后退出文件。</p>



<p class="wp-block-paragraph">重启Web服务器</p>



<pre class="wp-block-code"><code>nginx -s reload</code></pre>



<p class="wp-block-paragraph">验证模组是否安装成功</p>



<pre class="wp-block-code"><code>&#91;root@dameng etc]# /usr/local/php/bin/php -m
&#91;PHP Modules]
bcmath
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imagick
...
...</code></pre>



<p class="wp-block-paragraph">此时，回到WordPress配置界面查看站点健康依旧提示两模组未安装，需要重启PHP服务</p>



<pre class="wp-block-code"><code>&#91;root@dameng ~]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm  done</code></pre>



<p class="wp-block-paragraph">至此，再次查看站点健康便没有问题了。</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1024" height="325" src="https://www.lemonary.cn/wp-content/uploads/2024/11/image-299.png" alt="" class="wp-image-2138" srcset="https://www.lemonary.cn/wp-content/uploads/2024/11/image-299.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-299-300x95.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/11/image-299-768x244.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">问题解决。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lemonary.cn/wordpress%e7%ab%99%e7%82%b9%e5%81%a5%e5%ba%b7%e4%b9%8bphp%e6%a8%a1%e7%bb%84exif%e5%92%8cimagick/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 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="(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 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="(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">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">大佬的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">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/">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">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">鸦鸦的巢穴</a>【主题页眉、大部分CSS】</li>



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



<li><a href="https://www.liveout.cn/">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>
		<item>
		<title>Linux搭建WordPress详细教程</title>
		<link>https://www.lemonary.cn/linux%e6%90%ad%e5%bb%bawordpress%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b/</link>
					<comments>https://www.lemonary.cn/linux%e6%90%ad%e5%bb%bawordpress%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b/#respond</comments>
		
		<dc:creator><![CDATA[shine]]></dc:creator>
		<pubDate>Fri, 15 Nov 2024 06:53:00 +0000</pubDate>
				<category><![CDATA[建站记录]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://www.lemonary.cn/?p=1112</guid>

					<description><![CDATA[原文地址：https://blog.csdn.net/qingfeng812/article/details/ [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">原文地址：<a href="https://blog.csdn.net/qingfeng812/article/details/142780892">https://blog.csdn.net/qingfeng812/article/details/142780892</a></p>
</blockquote>



<h2 class="wp-block-heading" id="一、简单概述">一、简单概述</h2>



<p class="wp-block-paragraph">当前你所浏览的这个网站，就是我用WordPress搭建而成的，这篇文章就是我根据当初搭建WordPress的记录而写的。如果你也想用WordPress平台搭建自己的个人网站，那么可以参考这篇文章。</p>



<p class="wp-block-paragraph">本文是基于LNMP搭建WordPress平台的详细教程。</p>



<h2 class="wp-block-heading" id="二、准备工作">二、准备工作</h2>



<ul class="wp-block-list">
<li>一台Linux服务器【必备】：可以通过云服务厂商处购买：<a href="https://cn.aliyun.com/">阿里云</a>、<a href="https://www.huaweicloud.com/intl/zh-cn/">华为云</a>、<a href="https://cloud.tencent.com/">腾讯云</a>。</li>



<li>一个域名【非必备】：也可以通过云服务厂商处购买，没有域名也可以用IP直接来访问。</li>
</ul>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">建议：服务器和域名都从同一厂商处购买比较好。</p>
</blockquote>



<ul class="wp-block-list">
<li>一个远程shell工具【必备】：Xshell、SecureCRT、MobaXterm等等都可以，看你习惯。</li>
</ul>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">注意<br>1.从云服务器控制台中获取服务器的公网IP，端口。使用root用户密码即可从shell工具登录服务器。<br>2.可能在登录前需要在控制台将服务器的网络策略配置放开（就是开墙），以便登录和访问。</p>
</blockquote>



<p class="wp-block-paragraph">需要准备的内容大概就是这些，接下来就可以开始部署。</p>



<h2 class="wp-block-heading" id="三、部署手册">三、部署手册</h2>



<h3 class="wp-block-heading" id="3.1-部署LNMP">3.1 部署LNMP</h3>



<p class="wp-block-paragraph">LNMP是Linux+Nginx+MySQL+PHP的简写。</p>



<p class="wp-block-paragraph">另外还有：</p>



<ul class="wp-block-list">
<li>LAMP：Linux+Apache+MySQL+PHP</li>



<li>LNAMP：Linux+Nginx+Apache+MySQL+PHP</li>
</ul>



<p class="wp-block-paragraph">这些软件分别是：</p>



<ul class="wp-block-list">
<li>Linux：类 Unix 计算机操作系统。</li>



<li>Nginx：一个高性能的 HTTP 和反向代理服务器，也是一个 IMAP/POP3/SMTP 代理服务器。</li>



<li>Apache：世界使用排名第一的Web服务器软件。</li>



<li>MySQL：关系型数据库管理系统。</li>



<li>PHP：在服务器端执行的嵌入 HTML 文档的脚本语言。</li>
</ul>



<p class="wp-block-paragraph">这几个软件在安装时比较繁琐，尤其是数据库。所以我们可以根据集成的shell脚本一并安装他们。</p>



<p class="wp-block-paragraph"><strong>LNMP部署流程</strong></p>



<p class="wp-block-paragraph">可以直接访问网站：<a href="https://lnmp.org/notice/lnmp-v2-1.html">https://lnmp.org/notice/lnmp-v2-1.html</a>网站中写了详细的安装部署方法。本文也只是根据该网站的内容进行编写。</p>



<p class="wp-block-paragraph">（1）开启screen</p>



<pre class="wp-block-code"><code>screen -S lnmp</code></pre>



<p class="wp-block-paragraph">注意：或者使用 tmux，使用方法详见文档<a href="https://www.lemonary.cn/linux%e7%b3%bb%e7%bb%9ftmux%e7%bb%88%e7%ab%af%e5%a4%9a%e4%bb%bb%e5%8a%a1%e5%92%8c%e4%bc%9a%e8%af%9d%e7%ae%a1%e7%90%86%e5%b7%a5%e5%85%b7/">Linux系统tmux终端多任务和会话管理工具</a></p>



<p class="wp-block-paragraph">（2）下载、解压、安装</p>



<pre class="wp-block-code"><code>wget http://soft.lnmp.com/lnmp/lnmp2.1.tar.gz -O lnmp2.1.tar.gz &amp;&amp; tar zxf lnmp2.1.tar.gz &amp;&amp; cd lnmp2.1 &amp;&amp; ./install.sh lnmp</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">注意：最后面的lnmp参数，如需要lnmpa 或 lamp 模式，请替换lnmp为你要安装的模式。</p>
</blockquote>



<p class="wp-block-paragraph">（3）安装过程</p>



<p class="wp-block-paragraph">选择MySQL数据库的版本：默认是5.5.60，最好选择8+版本。选好数据库需要设置root用户的密码，配置好并做记录。这个密码很重要，是我们以后登录数据库必备的密码。<br>之后会询问是否需要启用&nbsp;MySQL&nbsp;InnoDB，InnoDB引擎默认为开启，一般建议开启，直接回车或输入 y 。</p>



<p class="wp-block-paragraph">选择PHP的版本：默认是5.6.36，最好也选择8+版本。（因为有些WordPress主题需要PHP版本比较高）</p>



<p class="wp-block-paragraph">选择是否安装内存优化：默认不安装（直接回车即可）</p>



<p class="wp-block-paragraph">如果是LNMPA或LAMP的话还会提示设置邮箱和选择Apache：<br>需要设置管理员邮箱，该邮箱会在报错时显示在错误页面上。<br>选择Apache的版本：默认版本（2.4.33）即可。</p>



<p class="wp-block-paragraph">提示&#8221;Press&nbsp;any&nbsp;key to install…or Press Ctrl+c to cancel&#8221;后，按回车键确认开始安装。 安装时间大约半小时。最终显示：</p>



<pre class="wp-block-code"><code>============================== Check install ==============================
Checking ...
Nginx: OK
MySQL: OK
PHP: OK
PHP-FPM: OK
Clean Web Server src directory...
+------------------------------------------------------------------------+
|          LNMP V2.1 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|           For more information please visit https://lnmp.org           |
+------------------------------------------------------------------------+
|    lnmp status manage: lnmp {start|stop|reload|restart|kill|status}    |
+------------------------------------------------------------------------+
|  phpMyAdmin: http://IP/phpmyadmin/                                     |
|  phpinfo: http://IP/phpinfo.php                                        |
|  Prober:  http://IP/p.php                                              |
+------------------------------------------------------------------------+
|  Add VirtualHost: lnmp vhost add                                       |
+------------------------------------------------------------------------+
|  Default directory: /home/wwwroot/default                              |
+------------------------------------------------------------------------+
|  MySQL/MariaDB root password: Admin1qaz                          |
+------------------------------------------------------------------------+
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
nginx (pid 1600642) is running...
php-fpm is runing!
MySQL running (1601228)                                    &#91;  OK  ]
State  Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
LISTEN 0      50           0.0.0.0:3306      0.0.0.0:*                 
LISTEN 0      128          0.0.0.0:22        0.0.0.0:*                   
       
Install lnmp takes 17 minutes.
Install lnmp V2.1 completed! enjoy it.</code></pre>



<p class="wp-block-paragraph">只要服务都是OK的，就表示安装成功没有问题。</p>



<p class="wp-block-paragraph">最后的端口：</p>



<ul class="wp-block-list">
<li>3306：MySQL</li>



<li>80：HTTP</li>



<li>22：SSH</li>
</ul>



<p class="wp-block-paragraph">（4）验证</p>



<p class="wp-block-paragraph">用浏览器访问http://ip，可以看到demo网页，表示配置成功。</p>



<h3 class="wp-block-heading" id="3.2-安装WordPress">3.2 安装WordPress</h3>



<p class="wp-block-paragraph">WordPress是使用PHP语言（这也是我们上面为什么要安装 PHP 的原因）开发的博客平台。</p>



<p class="wp-block-paragraph">安装的 LNMP，是保证了 WordPress 的基本运行环境。</p>



<p class="wp-block-paragraph">（1）下载、解压WordPress到/home/wwwroot/目录</p>



<pre class="wp-block-code"><code>wget https://cn.wordpress.org/latest-zh_CN.zip &amp;&amp; unzip latest-zh_CN.zip -d /home/wwwroot</code></pre>



<p class="wp-block-paragraph">（2）登录MySQL，创建wordpress数据库</p>



<pre class="wp-block-code"><code>mysql -u root -p
Enter password: 
MySQL &gt; create database wordpress;</code></pre>



<p class="wp-block-paragraph">（3）修改网站根目录属主</p>



<pre class="wp-block-code"><code>cd /home/wwwroot &amp;&amp; chown -R www wordpress/ &amp;&amp; chgrp -R www wordpress/</code></pre>



<h3 class="wp-block-heading" id="3.3-配置Nginx">3.3 配置Nginx</h3>



<p class="wp-block-paragraph">编辑Nginx配置文件/usr/local/nginx/conf/nginx.conf，如下</p>



<pre class="wp-block-code"><code>root  /home/wwwroot/default;
改成
root  /home/wwwroot/wordpress;</code></pre>



<p class="wp-block-paragraph">将网站的根目录设置为上一步存放wordpress的目录【我的是/home/wwwroot/wordpress】，根据实际目录自行配置。</p>



<p class="wp-block-paragraph">（4）重启Nginx</p>



<pre class="wp-block-code"><code>nginx -t
nginx -s reload</code></pre>



<h3 class="wp-block-heading" id="3.4-配置WordPress">3.4 配置WordPress</h3>



<p class="wp-block-paragraph">用浏览器打开http://ip/wp-admin/setup-config.php，就可以进行WordPress的配置。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="779" height="541" src="https://www.lemonary.cn/wp-content/uploads/2024/12/image-78.png" alt="" class="wp-image-1113" srcset="https://www.lemonary.cn/wp-content/uploads/2024/12/image-78.png 779w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-78-300x208.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-78-768x533.png 768w" sizes="auto, (max-width: 779px) 100vw, 779px" /></figure>



<p class="wp-block-paragraph">依次填写上述步骤中设置好的数据库名、用户名（root）、密码、数据库主机（IP），表前缀（随意配置即可）。</p>



<p class="wp-block-paragraph">直接下一步即可配置完成。之后，需要填写WordPress站点的一些配置信息（自定义即可）</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1021" height="1024" src="https://www.lemonary.cn/wp-content/uploads/2024/12/image-80-1021x1024.png" alt="" class="wp-image-1115" srcset="https://www.lemonary.cn/wp-content/uploads/2024/12/image-80-1021x1024.png 1021w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-80-300x300.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-80-150x150.png 150w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-80-768x770.png 768w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-80-1532x1536.png 1532w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-80.png 1590w" sizes="auto, (max-width: 1021px) 100vw, 1021px" /></figure>



<p class="wp-block-paragraph">配置完成后，即可登录WordPress平台开始搭建自己的个人网站。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="443" src="https://www.lemonary.cn/wp-content/uploads/2024/12/image-81-1024x443.png" alt="" class="wp-image-1116" srcset="https://www.lemonary.cn/wp-content/uploads/2024/12/image-81-1024x443.png 1024w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-81-300x130.png 300w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-81-768x332.png 768w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-81-1536x664.png 1536w, https://www.lemonary.cn/wp-content/uploads/2024/12/image-81-2048x886.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lemonary.cn/linux%e6%90%ad%e5%bb%bawordpress%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
