本篇是本站建立之后通过Echo等大佬的美化代码进行修改的一篇,主要写的就是我在CSS;页尾样式等的修改,可以根据自己的需求取用!
大佬的相关文章:Argon主题博客美化 – Echo小窝 (liveout.cn)
好了接下来就是正文了!
一、一键导入JSON
首先是我的Argon主题的一键导入JSON,可以作为参考:
{"argon_theme_color":"#90c3ee","argon_theme_color_hex_preview":"#90c3ee","argon_show_customize_theme_color_picker":true,"argon_enable_immersion_color":"true","argon_darkmode_autoswitch":"time","argon_enable_amoled_dark":"false","argon_card_radius":"15","argon_card_shadow":"default","argon_page_layout":"double","argon_article_list_waterflow":"1","argon_article_list_layout":"1","argon_font":"sans-serif","argon_assets_path":"jsdelivr_fastly","argon_custom_assets_path":"","argon_wp_path":"/blog/","argon_dateformat":"YMD","argon_enable_headroom":"true","argon_toolbar_title":"Small world","argon_toolbar_icon":"","argon_toolbar_icon_link":" ","argon_toolbar_blur":"true","argon_banner_title":"Breeze's blog","argon_banner_subtitle":"人のエゴで造られた 虚にだけはなりたくはなくて。","argon_banner_size":"fullscreen","argon_page_background_banner_style":"transparent","argon_show_toolbar_mask":true,"argon_banner_background_url":"","argon_banner_background_color_type":"shape-primary","argon_banner_background_hide_shapes":true,"argon_enable_banner_title_typing_effect":"true","argon_banner_typing_effect_interval":"100","argon_page_background_url":"https://xiaosj.xyz/blog/wp-content/uploads/2024/03/bg.png","argon_page_background_dark_url":"https://xiaosj.xyz/blog/wp-content/uploads/2024/03/bg.png","argon_page_background_opacity":"1","argon_sidebar_banner_title":"Breeze","argon_sidebar_banner_subtitle":"--hitokoto--","argon_sidebar_auther_name":"Atcool","argon_sidebar_auther_image":"https://xiaosj.xyz/blog/wp-content/uploads/2024/03/1000011721.jpg","argon_sidebar_author_description":"-永远相信美好的事情,即将发生-","argon_sidebar_announcement":"感谢来到我的博客,这里会不定期写一些游戏啦,我会的软件操作啦,当然也会转载很多教程~","argon_fab_show_settings_button":"true","argon_fab_show_darkmode_button":"true","argon_fab_show_gotocomment_button":"false","argon_seo_description":"网站描述 (Description Meta 标签)","argon_seo_keywords":"搜索引擎关键词(Keywords Meta 标签)","argon_article_meta":"time|categories|views","argon_show_readingtime":"true","argon_reading_speed":"580","argon_reading_speed_en":"80","argon_reading_speed_code":"10","argon_show_thumbnail_in_banner_in_content_page":"false","argon_first_image_as_thumbnail_by_default":"true","argon_reference_list_title":"参考","argon_show_sharebtn":"true","argon_show_headindex_number":"false","argon_donate_qrcode_url":"http://xiaosj.xyz/wp-content/uploads/2024/02/未标题-1.png","argon_additional_content_after_post":"如果觉得本篇写的有用或不错对您有帮助,可以点击上方投喂一下~谢谢~!","argon_related_post":"category,tag","argon_related_post_sort_orderby":"meta_value_num","argon_related_post_sort_order":"DESC","argon_related_post_limit":"10","argon_article_header_style":"article-header-style-2","argon_outdated_info_time_type":"createdtime","argon_outdated_info_days":"1","argon_outdated_info_tip_type":"inpost","argon_outdated_info_tip_content":"本文最后更新于%modify_date_delta% 天前,其中的信息可能已经过时,如有错误请发送邮件到coolbreeze2022@163.com","argon_archives_timeline_show_month":"true","argon_archives_timeline_url":"https://www.liveout.cn/pigeonhole/","argon_footer_html":"<style>\n /* 核心样式 */\n .github-badge {\n display: inline-block;\n border-radius: 4px;\n text-shadow: none;\n font-size: 13.1px;\n color: #45e110;\n line-height: 15px;\n margin-bottom: 5px;\n font-family: \"Open Sans\", sans-serif;\n }\n .github-badge .badge-subject {\n display: inline-block;\n background-color: #4d4d4d;\n padding: 4px 4px 4px 6px;\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n font-family: \"Open Sans\", sans-serif;\n }\n .github-badge .badge-value {\n display: inline-block;\n padding: 4px 6px 4px 4px;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n font-family: \"Open Sans\", sans-serif;\n }\n .github-badge-big {\n display: inline-block;\n border-radius: 6px;\n text-shadow: none;\n font-size: 14.1px;\n color: #00000f;\n line-height: 18px;\n margin-bottom: 7px;\n }\n .github-badge-big .badge-subject {\n display: inline-block;\n background-color: #4d4d4d;\n padding: 4px 4px 4px 6px;\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n }\n .github-badge-big .badge-value {\n display: inline-block;\n padding: 4px 6px 4px 4px;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n .bg-orange {\n background-color: #ec8a64 !important;\n }\n .bg-red {\n background-color: #cb7574 !important;\n }\n .bg-apricots {\n background-color: #f7c280 !important;\n }\n .bg-casein {\n background-color: #dfe291 !important;\n }\n .bg-shallots {\n background-color: #97c3c6 !important;\n }\n .bg-ogling {\n background-color: #95c7e0 !important;\n }\n .bg-haze {\n background-color: #9aaec7 !important;\n }\n .bg-mountain-terrier {\n background-color: #99a5cd !important;\n }\n.github-badge-big,\n.github-badge-big .badge-subject,\n.github-badge-big .badge-value {\n color: #000000 !important; /* 设置字体颜色为纯黑色 */\n}\n.github-badge-big .badge-subject,\n.github-badge-big .badge-value {\n background-color: transparent !important; /* 设置背景颜色为透明 */\n}\n.github-badge-big a {\n color: #000000 !important; /* 确保“黑公网安备”显示为黑色 */\n}\n\n/* 如果“@ Breeze”是单独显示,为其添加一个新的class并设置颜色 */\n.custom-class {\n color: #000000 !important;\n}\n/*字体加粗*/\n.global-bold {\n font-weight: bold !important;\n}\n </style>\n<div class=\"github-badge-big global-bold\">\n <!-- 移除了SVG图标,只保留图片和“备案号”文本 -->\n <span class=\"badge-subject\">\n <img src=\"https://xiaosj.xyz/blog/wp-content/uploads/2024/03/icpba.png\" alt=\"备案图标\" style=\"vertical-align:middle;margin-right:5px; width: 16px; height: 16px;\">\n 黑ICP备2024018475号\n </span>\n</div>\n<div class=\"github-badge-big global-bold\">\n <!-- 在“黑公网安备”前面插入图片 -->\n <span class=\"badge-subject\" style=\"background-color: transparent; padding: 0;\">\n <img src=\"https://xiaosj.xyz/blog/wp-content/uploads/2024/03/备案国徽图标-1.png\" alt=\"公安局网监备案图标\" style=\"vertical-align:middle;margin-right:5px; width: 16px; height: 16px;\">\n <a href=\"https://xiaosj.xyz/blog/wp-content/uploads/2024/03/备案国徽图标-1.png\" target=\"_blank\" one-link-mark=\"yes\">\n 黑公网安备23128102000153号\n </a>\n </span>\n</div>\n<div class=\"github-badge-big global-bold\">\n <span class=\"badge-subject\"><i class=\"fa fa-copyright\" aria-hidden=\"true\"></i> Copyright </span>\n <span class=\"badge-value bg-red\">2023-2024</span>\n <a href=\"https://www.xiaosj.xyz/\" target=\"_blank\" one-link-mark=\"yes\">@ Breeze\n </a>\n</div>\n\n<!-- 运行时间 -->\n<div class=\"github-badge-big global-bold\">\n <span class=\"badge-subject\"><i class=\"fa fa-clock-o\"></i> Running Time</span>\n <span class=\"badge-value bg-apricots\">\n <span id=\"blog_running_days\" class=\"odometer odometer-auto-theme\"></span> days\n <span id=\"blog_running_hours\" class=\"odometer odometer-auto-theme\"></span> H\n <span id=\"blog_running_mins\" class=\"odometer odometer-auto-theme\"></span> M\n <span id=\"blog_running_secs\" class=\"odometer odometer-auto-theme\"></span> S\n </span>\n</div>\n\n<script no-pjax=\"\">\n// 运行时间刷新逻辑...\n var blog_running_days = document.getElementById(\"blog_running_days\");\n var blog_running_hours = document.getElementById(\"blog_running_hours\");\n var blog_running_mins = document.getElementById(\"blog_running_mins\");\n var blog_running_secs = document.getElementById(\"blog_running_secs\");\n function refresh_blog_running_time() {\n var time = new Date() - new Date(2024, 1, 20, 0, 0, 0); /*此处日期的月份改为自己真正月份的前一个月*/\n var d = parseInt(time / 24 / 60 / 60 / 1000);\n var h = parseInt((time % (24 * 60 * 60 * 1000)) / 60 / 60 / 1000);\n var m = parseInt((time % (60 * 60 * 1000)) / 60 / 1000);\n var s = parseInt((time % (60 * 1000)) / 1000);\n blog_running_days.innerHTML = d;\n blog_running_hours.innerHTML = h;\n blog_running_mins.innerHTML = m;\n blog_running_secs.innerHTML = s;\n }\n refresh_blog_running_time();\n if (typeof bottomTimeIntervalHasSet == \"undefined\") {\n var bottomTimeIntervalHasSet = true;\n setInterval(function () {\n refresh_blog_running_time();\n }, 500);\n }\n </script>\n <script>\n \n function hexToRgb(hex,op){\n let str = hex.slice(1);\n let arr;\n if (str.length === 3) arr = str.split('').map(d => parseInt(d.repeat(2), 16));\n else arr = [parseInt(str.slice(0, 2), 16), parseInt(str.slice(2, 4), 16), parseInt(str.slice(4, 6), 16)];\n return `rgb(${arr.join(', ')}, ${op})`;\n };\n \n let themeColorHex = getComputedStyle(document.documentElement).getPropertyValue('--themecolor').trim();\n let op1 = 0.8\n let themeColorRgb = hexToRgb(themeColorHex,op1);\n let themecolorGradient = getComputedStyle(document.documentElement).getPropertyValue('--themecolor-gradient')\n \n document.documentElement.style.setProperty('--themecolor-gradient',themeColorRgb)\n let op2 = 0.8\n let colorTint92 = getComputedStyle(document.documentElement).getPropertyValue('--color-tint-92').trim();\n colorTint92 += ', '+op2;\n document.documentElement.style.setProperty('--color-tint-92',colorTint92)\n \n let op3 = 0.65\n let colorShade90 = getComputedStyle(document.documentElement).getPropertyValue('--color-shade-90').trim();\n colorShade90 += ', ' + op3;\n document.documentElement.style.setProperty('--color-shade-90',colorShade90)\n \n let op4 = 0.8\n let colorShade86 = getComputedStyle(document.documentElement).getPropertyValue('--color-shade-86').trim();\n colorShade86 += ', ' + op4;\n document.documentElement.style.setProperty('--color-shade-86',colorShade86)\n \n </script>","argon_enable_code_highlight":"true","argon_code_theme":"vs2015","argon_code_highlight_hide_linenumber":"true","argon_code_highlight_break_line":"false","argon_code_highlight_transparent_linenumber":"false","argon_math_render":"none","argon_mathjax_cdn_url":"//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js","argon_mathjax_v2_cdn_url":"//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML","argon_katex_cdn_url":"//cdn.jsdelivr.net/npm/katex@0.11.1/dist/","argon_enable_lazyload":"true","argon_lazyload_threshold":"800","argon_lazyload_effect":"fadeIn","argon_lazyload_loading_style":"1","argon_enable_fancybox":"true","argon_enable_zoomify":"false","argon_zoomify_duration":"200","argon_zoomify_easing":"cubic-bezier(0.4,0,0,1)","argon_zoomify_scale":"0.9","argon_enable_pangu":"article","argon_custom_html_head":"","argon_custom_html_foot":"<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css\">\n<script src=\"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js\"></script>\n \n<meting-js \n server=\"netease\" \n type=\"playlist\" \n id=\"7373135320\"\n fixed=\"true\" \n mini=\"true\"\n order=\"list\"\n loop=\"all\"\n preload=\"auto\"\n list-folded=\"true\"\n lrc-type=\"0\"\n>\n</meting-js>\n\n\n","argon_enable_smoothscroll_type":"1_pulse","argon_enable_into_article_animation":"true","argon_disable_pjax_animation":"false","argon_comment_pagination_type":"page","argon_comment_emotion_keyboard":"true","argon_hide_name_email_site_input":"false","argon_comment_need_captcha":"true","argon_get_captcha_by_ajax":"false","argon_comment_allow_markdown":"true","argon_comment_allow_editing":"true","argon_comment_allow_privatemode":"true","argon_comment_allow_mailnotice":"true","argon_comment_mailnotice_checkbox_checked":true,"argon_comment_enable_qq_avatar":"true","argon_comment_avatar_vcenter":"false","argon_who_can_visit_comment_edit_history":"commentsender","argon_enable_comment_pinning":"true","argon_enable_comment_upvote":"true","argon_comment_ua":"platform,browser","argon_show_comment_parent_info":"true","argon_fold_long_comments":"true","argon_gravatar_cdn":"gravatar.pho.ink/avatar/","argon_text_gravatar":"true","argon_enable_search_filters":"true","argon_search_filters_type":"*post,*page,shuoshuo","argon_pjax_disabled":"false","argon_hide_categories":"","argon_enable_login_css":"true","argon_home_show_shuoshuo":"false","argon_fold_long_shuoshuo":"true","argon_enable_timezone_fix":"false","argon_hide_shortcode_in_preview":"true","argon_trim_words_count":"0","argon_enable_mobile_scale":"false","argon_disable_googlefont":"false","argon_disable_codeblock_style":"false","argon_update_source":"github","argon_hide_footer_author":"true"}
二、左侧年度倒计时样式
这个倒计时是直接搬运的Echo文章里的
<div class="progress-wrapper" style="padding: 0">
<div class="progress-info">
<div class="progress-label">
<span id="yearprogress_yearname"></span>
</div>
<div id="yearprogress_text_container" class="progress-percentage">
<span id="yearprogress_progresstext"></span>
<span id="yearprogress_progresstext_full"></span>
</div>
</div>
<div class="progress">
<div id="yearprogress_progressbar" class="progress-bar bg-primary"></div>
</div>
</div>
<script no-pjax="">
function yearprogress_refresh() {
let year = new Date().getFullYear();
$("#yearprogress_yearname").text(year);
let from = new Date(year, 0, 1, 0, 0, 0);
let to = new Date(year, 11, 31, 23, 59, 59);
let now = new Date();
let progress = (((now - from) / (to - from + 1)) * 100).toFixed(7);
let progressshort = (((now - from) / (to - from + 1)) * 100).toFixed(2);
$("#yearprogress_progresstext").text(progressshort + "%");
$("#yearprogress_progresstext_full").text(progress + "%");
$("#yearprogress_progressbar").css("width", progress + "%");
}
yearprogress_refresh();
if (typeof yearProgressIntervalHasSet == "undefined") {
var yearProgressIntervalHasSet = true;
setInterval(function () {
yearprogress_refresh();
}, 500);
}
</script>
<style>
#yearprogress_text_container {
width: 100%;
height: 22px;
overflow: hidden;
user-select: none;
}
#yearprogress_text_container > span {
transition: all 0.3s ease;
display: block;
}
#yearprogress_text_container:hover > span {
transform: translateY(-45px);
}
</style>
三、网页底部信息(经过修改的)
这个是根据个人喜好更改的,由于学艺不精,基本就是屎山,一层堆一层……
复制以下代码到:Argon主题设置-页脚将其粘贴进去更改ICP备案号与公网安备号即可。
<style>
/* 核心样式 */
.github-badge {
display: inline-block;
border-radius: 4px;
text-shadow: none;
font-size: 13.1px;
color: #45e110;
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: #00000f;
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,
.github-badge-big .badge-subject,
.github-badge-big .badge-value {
color: #000000 !important;
}
.github-badge-big .badge-subject,
.github-badge-big .badge-value {
background-color: transparent !important;
}
.github-badge-big a {
color: #000000 !important;
}
.custom-class {
color: #000000 !important;
}
.global-bold {
font-weight: bold !important;
}
</style>
<div class="github-badge-big global-bold">
<!-- src后面的链接设置为自己的ICP备案图标 然后把ICP备案号改为自己的 -->
<span class="badge-subject">
<img src="https://xiaosj.xyz/blog/wp-content/uploads/2024/03/icpba.png" alt="备案图标" style="vertical-align:middle;margin-right:5px; width: 16px; height: 16px;">
<a href="https://beian.miit.gov.cn/" target="_blank" one-link-mark="yes">
黑ICP备2024018475号
</span>
</div>
<div class="github-badge-big global-bold">
<!-- src后面的链接设置为自己的公网安备图标 然后把公网安备号改为自己的 -->
<span class="badge-subject" style="background-color: transparent; padding: 0;">
<img src="https://xiaosj.xyz/blog/wp-content/uploads/2024/03/备案国徽图标-1.png" alt="公安局网监备案图标" style="vertical-align:middle;margin-right:5px; width: 16px; height: 16px;">
<a href="https://beian.mps.gov.cn/#/query/webSearch" target="_blank" one-link-mark="yes">
黑公网安备23128102000153号
</a>
</span>
</div>
<div class="github-badge-big global-bold">
<span class="badge-subject"><i class="fa fa-copyright" aria-hidden="true"></i> Copyright </span>
<span class="badge-value bg-red">2023-2024</span>
<a href="https://www.xiaosj.xyz/" target="_blank" one-link-mark="yes">@ Breeze <!--这里的href设置为自己的域名,后面的@Breeze改为自己喜欢的名字-->
</a>
</div>
<!-- 运行时间 -->
<div class="github-badge-big global-bold">
<span class="badge-subject"><i class="fa fa-clock-o"></i> Running Time</span>
<span class="badge-value bg-apricots">
<span id="blog_running_days" class="odometer odometer-auto-theme"></span> days
<span id="blog_running_hours" class="odometer odometer-auto-theme"></span> H
<span id="blog_running_mins" class="odometer odometer-auto-theme"></span> M
<span id="blog_running_secs" class="odometer odometer-auto-theme"></span> S
</span>
</div>
<script no-pjax="">
// 运行时间刷新逻辑...
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, 1, 20, 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);
}
</script>
<script>
function hexToRgb(hex,op){
let str = hex.slice(1);
let arr;
if (str.length === 3) arr = str.split('').map(d => parseInt(d.repeat(2), 16));
else arr = [parseInt(str.slice(0, 2), 16), parseInt(str.slice(2, 4), 16), parseInt(str.slice(4, 6), 16)];
return `rgb(${arr.join(', ')}, ${op})`;
};
let themeColorHex = getComputedStyle(document.documentElement).getPropertyValue('--themecolor').trim();
let op1 = 0.8
let themeColorRgb = hexToRgb(themeColorHex,op1);
let themecolorGradient = getComputedStyle(document.documentElement).getPropertyValue('--themecolor-gradient')
document.documentElement.style.setProperty('--themecolor-gradient',themeColorRgb)
let op2 = 0.8
let colorTint92 = getComputedStyle(document.documentElement).getPropertyValue('--color-tint-92').trim();
colorTint92 += ', '+op2;
document.documentElement.style.setProperty('--color-tint-92',colorTint92)
let op3 = 0.65
let colorShade90 = getComputedStyle(document.documentElement).getPropertyValue('--color-shade-90').trim();
colorShade90 += ', ' + op3;
document.documentElement.style.setProperty('--color-shade-90',colorShade90)
let op4 = 0.8
let colorShade86 = getComputedStyle(document.documentElement).getPropertyValue('--color-shade-86').trim();
colorShade86 += ', ' + op4;
document.documentElement.style.setProperty('--color-shade-86',colorShade86)
</script>
四、footer.php内样式
(里面注释掉的就是不需要的,可以根据喜好更改)
放置位置:外观
–主题文件编辑器内找到footer.php文件
,如果主题文件编辑器里没有的话可以在/www/wwwroot/<你的网站名称>/wp-content/themes/argon-theme-1.3.5(注意如果有子目录请在网站名称下一级打开你的子目录然后再找wp-content即可;“argon-theme-1.3.5是你主题的名称”)
<footer id="footer" class="site-footer card shadow-sm border-0">
<?php
echo get_option('argon_footer_html');
?>
<div>Theme <a href="https://github.com/solstice23/argon-theme" target="_blank"><strong>Argon</strong></a><?php if (get_option('argon_hide_footer_author') != 'true') {echo " By solstice23"; }?></div>
</footer>
</main>
</div>
</div>
<script src="<?php echo $GLOBALS['assets_path']; ?>/argontheme.js?v<?php echo $GLOBALS['theme_version']; ?>"></script>
<?php if (get_option('argon_math_render') == 'mathjax3') { /*Mathjax V3*/?>
<script>
window.MathJax = {
tex: {
inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
displayMath: [['$$','$$']],
processEscapes: true,
packages: {'[+]': ['noerrors']}
},
options: {
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'],
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/noerrors']
}
};
</script>
<script src="<?php echo get_option('argon_mathjax_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' : get_option('argon_mathjax_cdn_url'); ?>" id="MathJax-script" async></script>
<?php }?>
<?php if (get_option('argon_math_render') == 'mathjax2') { /*Mathjax V2*/?>
<script type="text/x-mathjax-config" id="mathjax_v2_script">
MathJax.Hub.Config({
messageStyle: "none",
tex2jax: {
inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
displayMath: [['$$','$$']],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
},
menuSettings: {
zoom: "Hover",
zscale: "200%"
},
"HTML-CSS": {
showMathMenu: "false"
}
});
</script>
<script src="<?php echo get_option('argon_mathjax_v2_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-AMS_HTML' : get_option('argon_mathjax_v2_cdn_url'); ?>"></script>
<?php }?>
<?php if (get_option('argon_math_render') == 'katex') { /*Katex*/?>
<link rel="stylesheet" href="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>katex.min.css">
<script src="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>katex.min.js"></script>
<script src="<?php echo get_option('argon_katex_cdn_url') == '' ? '//cdn.jsdelivr.net/npm/katex@0.11.1/dist/' : get_option('argon_katex_cdn_url'); ?>contrib/auto-render.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body,{
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
{left: "\\(", right: "\\)", display: false}
]
});
});
</script>
<?php }?>
<?php if (get_option('argon_enable_code_highlight') == 'true') { /*Highlight.js*/?>
<link rel="stylesheet" href="<?php echo $GLOBALS['assets_path']; ?>/assets/vendor/highlight/styles/<?php echo get_option('argon_code_theme') == '' ? 'vs2015' : get_option('argon_code_theme'); ?>.css">
<?php }?>
</div>
</div>
<?php
wp_enqueue_script("argonjs", $GLOBALS['assets_path'] . "/assets/js/argon.min.js", null, $GLOBALS['theme_version'], true);
?>
<?php wp_footer(); ?>
<!--网站输入效果开始-->
<script src="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/input-with-fire.js"></script>
</body>
<?php echo get_option('argon_custom_html_foot'); ?>
</html>
<!--全页特效开始-->
<script src="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/mobile-detect.js"></script>
<script type="text/javascript">
// 设备检测
var md = new MobileDetect(window.navigator.userAgent);
// PC生效,手机/平板不生效
// md.mobile(); md.phone();
if(!md.phone()){
if(!md.tablet()){
// 雪花
//$.getScript("https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/xiaxue.js");
// 樱花
// $.getScript("https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/yinghua.js");
// 小烟花特效
$.getScript("https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/js/mouse-click.js");
// 大烟花特效
//$.getScript("https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/mouse-click-02/mouse-canvas.js");
//document.write('<style>#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;}</style>')
// 鼠标移动的仙女棒特效。
$.getScript("https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/halo-dream/fairyDustCursor.min.js");
// 鼠标移动的泡泡特效
// $.getScript("https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/mouse/joe/censor10.js");
// 春节灯笼
//document.write('<link href="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper@latest/css/deng.css" rel="stylesheet">');
//document.write('<div class="deng-box"><div class="deng"><div class="xian"></div><div class="deng-a"><div class="deng-b"><div class="deng-t">春节</div></div></div><div class="shui shui-a"><div //class="shui-c"></div><div class="shui-b"></div></div></div></div>');
//document.write('<div class="deng-box1"><div class="deng"><div class="xian"></div><div class="deng-a"><div class="deng-b"><div class="deng-t">快乐</div></div></div><div class="shui shui-a"><div //class="shui-c"></div><div class="shui-b"></div></div></div></div>');
}
}
</script>
<!--全页特效结束-->
<!--滚动模糊-->
<script>
window.addEventListener("scroll", function (e) {
if (window.scrollY > window.innerHeight * 0.3) {
document.querySelector("#content").classList.add("scrolled");
} else {
document.querySelector("#content").classList.remove("scrolled");
}
});</script>
<style>
#content.scrolled::before, #content.scrolled::after {
filter: blur(5px); /*数字越大虚化越明显*/
transform: scale(1.02); /*数字越大背景放大越明显*/
}
#content::before, #content::after {
transition: filter .3s ease, transform .3s ease !important;
filter: blur(0px);
transform: scale(1.02);
}
</style>
五、额外CSS样式
下面CSS样式是根据我个人喜好更改的,其中一段注释掉的代码是全页黑白,需要时只需要删掉注释即可~
放置位置:外观
–自定义
–额外CSS
/*网站字体*/
/*原则上你可以设置多个字体,然后在不同的部位使用不同的字体。*/
@font-face{
font-family:echo;
src:url(https://fastly.jsdelivr.net/gh/huangwb8/bloghelper@latest/fonts/13.woff2) format('woff2')
}
body{
font-family: 'echo', Georgia, -apple-system, 'Nimbus Roman No9 L', 'PingFang SC', 'Hiragino Sans GB', 'Noto Serif SC', 'Microsoft Yahei', 'WenQuanYi Micro Hei', 'ST Heiti', sans-serif
}
/*横幅字体大小*/
.banner-title {
font-size: 2.5em;
}
.banner-subtitle{
font-size: 28px;
-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;
}
/*文章标题字体大小*/
.post-title {
font-size: 25px
}
/*正文字体大小(不包含代码)*/
.post-content p{
font-size: 1.25rem;
}
li{
font-size: 1.2rem;
}
/*评论区字体大小*/
p {
font-size: 1.2rem
}
/*评论发送区字体大小*/
.form-control{
font-size: 1.2rem
}
/*评论勾选项目字体大小*/
.custom-checkbox .custom-control-input~.custom-control-label{
font-size: 1.2rem
}
/*评论区代码的强调色*/
code {
color: rgba(var(--themecolor-rgbstr));
}
/*说说字体大小和颜色设置*/
.shuoshuo-title {
font-size: 25px;
/* color: rgba(var(--themecolor-rgbstr)); */
}
/*尾注字体大小*/
.additional-content-after-post{
font-size: 1.2rem
}
/* 公告居中 */
.leftbar-announcement-title {
font-size: 20px;
/* text-align: center; */
color:#007fff;
}
.leftbar-announcement-content {
font-size: 15px;
line-height: 1.8;
padding-top: 8px;
opacity: 1;
/* text-align: center; */
color:#00FFFF;
}
/* 一言居中 */
.leftbar-banner-title {
font-size: 20px;
display: block;
text-align: center;
opacity: 0.8;
}
/* 个性签名居中 */
.leftbar-banner-subtitle {
margin-top: 15px;
margin-bottom: 8px;
font-size: 13px;
opacity: 0.8;
display: block;
text-align: center;
}
/*========颜色设置===========*/
/*文章或页面的正文颜色*/
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 > a:hover, .leftbar-menu-item.current > a{
background-color: 90c3ee;
}
/*站点概览分隔线颜色修改*/
.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;
}
/*========透明设置===========*/
/*白天卡片背景透明*/
.card{
background-color:rgba(255, 255, 255, 0.9) !important;
/*backdrop-filter:blur(6px);*//*毛玻璃效果主要属性*/
-webkit-backdrop-filter:blur(6px);
}
/*小工具栏背景完全透明*/
/*小工具栏是card的子元素,如果用同一个透明度会叠加变色,故改为完全透明*/
.card .widget,.darkmode .card .widget,#post_content > div > div > 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 > div.page-information-card-container > div > div{
text-align:center;
}
/*子菜单对齐及样式调整*/
.dropdown-menu .dropdown-item>i{
width: 10px;
}
.dropdown-menu>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>a{
padding: 0rem 1.5rem 0rem 1rem;
}
/*左侧栏边距修改*/
.tab-content{
padding:10px 0px 0px 0px !important;
}
.site-author-links{
padding:0px 0px 0px 10px ;
}
/*目录位置偏移修改*/
#leftbar_catalog{
margin-left: 0px;
}
/*目录条目边距修改*/
#leftbar_catalog .index-link{
padding: 4px 4px 4px 4px;
}
/*左侧栏小工具栏字体缩小*/
#leftbar_tab_tools{
font-size: 14px;
}
/*正文图片边距修改*/
article figure {margin:0;}
/*正文图片居中显示*/
.fancybox-wrapper {
margin: auto;
}
/*正文表格样式修改*/
article table > tbody > tr > td,
article table > tbody > tr > th,
article table > tfoot > tr > td,
article table > tfoot > tr > th,
article table > thead > tr > td,
article table > thead > tr > 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: 1rem;
font-family: 'echo';
}
.navbar-brand {
font-family: 'echo';
font-size: 1.2rem;
margin-right: 1.0 rem;
padding-bottom: 0.2 rem;
-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;
}
/*菜单大小*/
.nav-link-inner--text {
font-size: 1.25em;
}
.navbar-nav .nav-item {
margin-right:0;
}
.mr-lg-5, .mx-lg-5 {
margin-right:1rem !important;
}
.navbar-toggler-icon {
width: 1.8rem;
height: 1.8rem;
}
/*菜单间距*/
.navbar-expand-lg .navbar-nav .nav-link {
padding-right: 1.4em;
padding-left: 1.4em;
}
/*隐藏wp-SEO插件带来的线条阴影(不一定要装)*/
*[style='position: relative; z-index: 99998;'] {
display: none;
}
/* Github卡片样式*/
.github-info-card-header a {
/*Github卡片抬头颜色*/
color: black !important;
font-size: 1.5rem;
}
.github-info-card {
/*Github卡片文字(非链接)*/
font-size: 1rem;
color: black !important;
}
.github-info-card.github-info-card-full.card.shadow-sm {
/*Github卡片背景色*/
background-color: rgba(var(--themecolor-rgbstr), 0.1) !important;
}
/* 左侧栏外观CSS */
/* 头像 */
#leftbar_overview_author_image {
width: 100px;
height: 100px;
margin: auto;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-color: rgba(127, 127, 127, 0.1);
overflow: hidden;
transition: transform 0.3s ease;
}
/* 头像亮暗 */
#leftbar_overview_author_image:hover {
transform: scale(1.23);
filter: brightness(150%);
}
/* 名称 */
#leftbar_overview_author_name {
margin-top: 15px;
font-size: 18px;align-content;
color:#00FFFF;
}
/* 简介 */
#leftbar_overview_author_description {
font-size: 14px;
margin-top: -4px;
opacity: 0.8;
color:#c21f30;
}
/* 标题,链接等 */
a, .btn-neutral {
color:#AF7AC5 ;
}
/* 页脚透明 */
#footer {
background: var(--themecolor-gradient);
color: #fff;
width: 100%;
float: right;
margin-bottom: 25px;
text-align: center;
padding: 25px 20px;
line-height: 1.8;
transition: none;
opacity: 0.6;
}
#leftbar_overview_author_image {
width: 100px;
height: 100px;
margin: auto;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-color: rgba(127, 127, 127, 0.1);
overflow: hidden;
box-shadow: 0 0 5px rgba(116, 8, 204, 0.3);
transition: transform 0.3s ease; /*变化速度*/
}
#leftbar_overview_author_image:hover {
transform: scale(1.2); /*缩放大小*/
filter: brightness(150%); /*调节亮度*/
}
/*网站黑白色(悼念)*/
< --!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);
}
#leftbar_announcement {
background: var(--themecolor-gradient) !important;
}
#footer{
background: var(--themecolor-gradient) !important
} -->
六、在评论显示头像
在 外观
— 主题文件编辑器
中的 function
模板函数添加此代码
if ( ! function_exists( 'get_cravatar_url' ) ) {
/**
* 把Gravatar头像服务替换为Cravatar
* @param string $url
* @return string
*/
function get_cravatar_url( $url ) {
$sources = array(
'www.gravatar.com',
'0.gravatar.com',
'1.gravatar.com',
'2.gravatar.com',
'secure.gravatar.com',
'cn.gravatar.com'
);
return str_replace( $sources, 'cravatar.cn', $url );
}
add_filter( 'um_user_avatar_url_filter', 'get_cravatar_url', 1 );
add_filter( 'bp_gravatar_url', 'get_cravatar_url', 1 );
add_filter( 'get_avatar_url', 'get_cravatar_url', 1 );
}
六、页面底部自定义HTML按钮
这个按钮主要是用于贴赞助链接的,如果有更好的选择可以自己写~
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.centered-button {
display: flex;
justify-content: center;
align-items: center;
margin: 0;
padding: 0;
height: 60px;
}
.popup-container {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.8);
padding: 20px;
border-radius: 10px;
z-index: 999;
}
.popup-container.visible {
display: block;
}
.popup-image {
max-width: 90%;
height: auto;
border-radius: 10px;
margin-bottom: 10px;
}
.button-rounded {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
transition: background-color 0.3s ease;
border-radius: 20px;
}
.button-rounded:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="centered-button">
<button id="toggleButton" onclick="toggleImage()" class="button-rounded">投喂</button>
</div>
<div id="popup" class="popup-container">
<img id="myImagePopup" src="你的投喂链接URL" class="popup-image" width="500" height="250">
</div>
<script>
var popup = document.getElementById('popup');
var popupImage = document.getElementById("myImagePopup");
var toggleButton = document.getElementById('toggleButton');
function toggleImage() {
if (popup.style.display === "none") {
showImage();
} else {
hideImage();
}
}
function showImage() {
popup.style.display = "block";
popupImage.style.display = "block";
}
function hideImage() {
popup.style.display = "none";
popupImage.style.display = "none";
}
// (可选)取消鼠标悬停时保持图片显示的逻辑
// popupImage.onmouseover = keepImage;
// popupImage.onmouseout = hideImage;
</script>
</body>
</html>
七、下方为搬运的Echo的文章
插件合集
12.1 网站访问数据 (左侧栏)
- 进入 WordPress,点击插件,搜索并且下载 Wp Statistics
- 外观 —— 小工具 —— 站点额外内容 —— 旧版小工具 —— 统计
12.2 评论 IP 地址
以下根据体验自己选择
WP-UserAgent | kyleabaker.com From 友链大佬:obaby@mars (h4ck.org.cn)
WordPress 展示评论者地理位置插件 Easy Location | 歲月留聲 (0xo.net)
12.3 评论管理
Akismet Anti-Spam: Spam Protection
12.4 邮件发送
WP Mail SMTP
12.5 文章字数统计
WP Word Count
12.6 WP 用户个人头像
Simple Local Avatars
教程视频
个人博客网站 (WordPress) 基本使用哔哩哔哩 bilibili
推荐文章
- 个人博客网站搭建 – Echo (liveout.cn)
- 个人博客主题分享 (WordPress) – Echo (liveout.cn)
- 博客图片托管到又拍云教程 – Echo (liveout.cn)
- WordPress/Typecho 博客搬迁教程 – Echo (liveout.cn)
相关链接
本文可能涉及的代码出自以下博客文章,十分感谢下面各位大佬的分享
关于 Argon 主题 更多美化内容文章: Argon 主题的美化设置 – Gong_cx (gcxstudio.cn)
博客透明、鼠标等美化: Docker 系列 WordPress 系列 特效 – Bensz (hwb0307.com)
博客添加音乐插件: https://echeverra.cn/aplayer
Argon 主题 GitHub 地址:solstice23/argon-theme: 📖 Argon – 一个轻盈、简洁的 WordPress 主题 (github.com)
Argon 主题作者博客:solstice23 – Blog
Argon 主题使用文档:Argon Theme Docs (solstice23.top)
FAQ
如果遇到问题无法解决,请参考以下途径
- B 站视频:博客搭建常见问题汇总哔哩哔哩 bilibili
- 翻翻评论区,已经有许多问题提出和解决了,大部分都一样
- 查看官方文档
如果问题还未解决,请评论区留言
awa