revert: 回档到 b613e01,保留 code-style 规范文档
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<?php } ?>
|
||||
<p class="text-black mt-3 mb-0 opacity-8">
|
||||
<i class="fa fa-file-o mr-1"></i>
|
||||
<?php echo $wp_query->found_posts; ?> <?php _e('篇文章', 'argon');?>
|
||||
<?php echo $wp_query -> found_posts; ?> <?php _e('篇文章', 'argon');?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
10
comments.php
10
comments.php
@@ -364,7 +364,7 @@ function resetGeetestCaptcha() {
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user-circle"></i></span>
|
||||
</div>
|
||||
<input id="post_comment_name" class="form-control" placeholder="<?php _e('昵称', 'argon');?>" type="text" name="author" value="<?php if (is_user_logged_in()) {echo (wp_get_current_user()->user_login);} else {echo htmlspecialchars($current_commenter['comment_author']);} ?>">
|
||||
<input id="post_comment_name" class="form-control" placeholder="<?php _e('昵称', 'argon');?>" type="text" name="author" value="<?php if (is_user_logged_in()) {echo (wp_get_current_user() -> user_login);} else {echo htmlspecialchars($current_commenter['comment_author']);} ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -374,7 +374,7 @@ function resetGeetestCaptcha() {
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
|
||||
</div>
|
||||
<input id="post_comment_email" class="form-control" placeholder="<?php _e('邮箱', 'argon');?><?php if ($enable_qq_avatar == 'true'){echo __(' / QQ 号', 'argon');} ?>" type="email" name="email" value="<?php if (is_user_logged_in()) {echo (wp_get_current_user()->user_email);} else {echo htmlspecialchars($current_commenter['comment_author_email']);} ?>">
|
||||
<input id="post_comment_email" class="form-control" placeholder="<?php _e('邮箱', 'argon');?><?php if ($enable_qq_avatar == 'true'){echo __(' / QQ 号', 'argon');} ?>" type="email" name="email" value="<?php if (is_user_logged_in()) {echo (wp_get_current_user() -> user_email);} else {echo htmlspecialchars($current_commenter['comment_author_email']);} ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -383,14 +383,16 @@ function resetGeetestCaptcha() {
|
||||
<?php
|
||||
$captcha_type = get_option('argon_captcha_type', 'math');
|
||||
if ($captcha_type === 'geetest') { ?>
|
||||
<!-- Geetest 验证码容器 --><div id="geetest-captcha" class="mb-4"></div>
|
||||
<!-- Geetest 验证码容器 -->
|
||||
<div id="geetest-captcha" class="mb-4"></div>
|
||||
<input type="hidden" id="geetest_lot_number" name="lot_number" value="">
|
||||
<input type="hidden" id="geetest_captcha_output" name="captcha_output" value="">
|
||||
<input type="hidden" id="geetest_pass_token" name="pass_token" value="">
|
||||
<input type="hidden" id="geetest_gen_time" name="gen_time" value="">
|
||||
<input type="hidden" id="argon_comment_nonce" value="<?php echo wp_create_nonce('argon_comment'); ?>">
|
||||
<?php } else { ?>
|
||||
<!-- 原有的数学验证码 --><div class="input-group input-group-alternative mb-4 post-comment-captcha-container" captcha="<?php echo get_comment_captcha(get_comment_captcha_seed());?>">
|
||||
<!-- 原有的数学验证码 -->
|
||||
<div class="input-group input-group-alternative mb-4 post-comment-captcha-container" captcha="<?php echo get_comment_captcha(get_comment_captcha_seed());?>">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-key"></i></span>
|
||||
</div>
|
||||
|
||||
15
footer.php
15
footer.php
@@ -29,7 +29,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 加载主题核心 JS --><?php $assets_version = function_exists('argon_get_assets_version') ? argon_get_assets_version() : $GLOBALS['theme_version']; ?>
|
||||
<!-- 加载主题核心 JS -->
|
||||
<?php $assets_version = function_exists('argon_get_assets_version') ? argon_get_assets_version() : $GLOBALS['theme_version']; ?>
|
||||
<script src="<?php echo $GLOBALS['assets_path']; ?>/argontheme.js?v=<?php echo $assets_version; ?>"></script>
|
||||
|
||||
<?php if (get_option('argon_math_render') == 'mathjax3') { /*Mathjax V3*/?>
|
||||
@@ -148,13 +149,17 @@
|
||||
|
||||
<?php }?>
|
||||
|
||||
<?php if (get_option('argon_enable_code_highlight') == 'true') { /*Highlight.js*/?>
|
||||
|
||||
|
||||
<?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>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -162,6 +167,10 @@
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
<?php echo get_option('argon_custom_html_foot'); ?>
|
||||
|
||||
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
/**
|
||||
* 友情链接页面
|
||||
* @package Argon
|
||||
@@ -468,7 +468,8 @@ $flink_slogan = get_option('argon_friend_link_slogan', __('海内存知己,天
|
||||
$flink_welcome = get_option('argon_friend_link_welcome', __('欢迎与我交换友链!如果您的网站已添加本站链接,填写友链页面地址可自动通过审核。', 'argon'));
|
||||
?>
|
||||
|
||||
<!-- 头部卡片 --><div class="flinks-header-card" style="margin-bottom: 16px;">
|
||||
<!-- 头部卡片 -->
|
||||
<div class="flinks-header-card" style="margin-bottom: 16px;">
|
||||
<div class="flinks-header-icon"><i class="fa fa-link"></i></div>
|
||||
<h1 class="flinks-title"><?php _e('友情链接', 'argon'); ?></h1>
|
||||
<p class="flinks-subtitle"><?php echo esc_html($flink_slogan); ?></p>
|
||||
@@ -480,7 +481,8 @@ $flink_welcome = get_option('argon_friend_link_welcome', __('欢迎与我交换
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 管理面板(仅管理员可见) --><?php if ($is_admin) : ?>
|
||||
<!-- 管理面板(仅管理员可见) -->
|
||||
<?php if ($is_admin) : ?>
|
||||
<article class="post card shadow-sm bg-white border-0 flinks-admin-card" style="margin-bottom: 16px;" id="admin-panel">
|
||||
<div class="flinks-admin-title"><i class="fa fa-cog"></i><?php _e('友链管理', 'argon'); ?> <button class="btn btn-sm btn-secondary" style="margin-left:auto;font-size:11px;" id="check-all-btn"><?php _e('检测所有友链', 'argon'); ?></button></div>
|
||||
|
||||
@@ -538,7 +540,8 @@ $flink_welcome = get_option('argon_friend_link_welcome', __('欢迎与我交换
|
||||
</article>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 友链列表 --><?php if (!empty($links)) : ?>
|
||||
<!-- 友链列表 -->
|
||||
<?php if (!empty($links)) : ?>
|
||||
<?php $color_index = 0; foreach ($links as $category => $category_links) : ?>
|
||||
<article class="post card shadow-sm bg-white border-0 flinks-category-card" style="margin-bottom: 16px;">
|
||||
<div class="flinks-category-header">
|
||||
@@ -604,7 +607,8 @@ $flink_welcome = get_option('argon_friend_link_welcome', __('欢迎与我交换
|
||||
</article>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 申请友链 --><?php if ($show_apply_form && !$is_admin) : ?>
|
||||
<!-- 申请友链 -->
|
||||
<?php if ($show_apply_form && !$is_admin) : ?>
|
||||
<article class="post card shadow-sm bg-white border-0 flinks-apply-card" style="margin-bottom: 16px;" id="apply-section">
|
||||
<div class="flinks-apply-header" onclick="toggleApplyForm()">
|
||||
<div class="flinks-apply-title"><i class="fa fa-plus-circle"></i><span><?php _e('申请友链', 'argon'); ?></span></div>
|
||||
@@ -674,7 +678,8 @@ $flink_welcome = get_option('argon_friend_link_welcome', __('欢迎与我交换
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 验证码 --><?php if ($captcha_enabled) : ?>
|
||||
<!-- 验证码 -->
|
||||
<?php if ($captcha_enabled) : ?>
|
||||
<div class="flinks-captcha">
|
||||
<?php if ($captcha_type === 'geetest') : ?>
|
||||
<div id="flink-geetest-captcha"></div>
|
||||
@@ -701,7 +706,8 @@ $flink_welcome = get_option('argon_friend_link_welcome', __('欢迎与我交换
|
||||
</article>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 编辑弹窗 --><?php if ($is_admin) : ?>
|
||||
<!-- 编辑弹窗 -->
|
||||
<?php if ($is_admin) : ?>
|
||||
<div class="flink-modal-overlay" id="edit-modal">
|
||||
<div class="flink-modal">
|
||||
<div class="flink-modal-title">
|
||||
|
||||
195
functions.php
195
functions.php
@@ -29,7 +29,7 @@ function theme_slug_setup() {
|
||||
}
|
||||
add_action('after_setup_theme','theme_slug_setup');
|
||||
|
||||
$argon_version = !(wp_get_theme()->Template) ? wp_get_theme()->Version : wp_get_theme(wp_get_theme()->Template)->Version;
|
||||
$argon_version = !(wp_get_theme() -> Template) ? wp_get_theme() -> Version : wp_get_theme(wp_get_theme() -> Template) -> Version;
|
||||
$GLOBALS['theme_version'] = $argon_version;
|
||||
|
||||
// 强制使用本地资源,避免 CDN 加载问题
|
||||
@@ -219,6 +219,7 @@ if (version_compare($argon_last_version, $GLOBALS['theme_version'], '<' )){
|
||||
update_option("argon_last_version", $GLOBALS['theme_version']);
|
||||
}
|
||||
|
||||
|
||||
//引入邮件模板系统
|
||||
require_once(get_template_directory() . '/email-templates/base.php');
|
||||
require_once(get_template_directory() . '/email-templates/comment-notify.php');
|
||||
@@ -960,7 +961,7 @@ function argon_get_first_image_of_article(){
|
||||
if (post_password_required()){
|
||||
return false;
|
||||
}
|
||||
$post_content_full = apply_filters('the_content', preg_replace( '<!--more(.*?)-->', '', $post->post_content));
|
||||
$post_content_full = apply_filters('the_content', preg_replace( '<!--more(.*?)-->', '', $post -> post_content));
|
||||
preg_match('/<img(.*?)(src|data-original)=[\"\']((http:|https:)?\/\/(.*?))[\"\'](.*?)\/?>/', $post_content_full, $match);
|
||||
if (isset($match[3])){
|
||||
return $match[3];
|
||||
@@ -970,7 +971,7 @@ function argon_get_first_image_of_article(){
|
||||
function argon_has_post_thumbnail($postID = 0){
|
||||
if ($postID == 0){
|
||||
global $post;
|
||||
$postID = $post->ID;
|
||||
$postID = $post -> ID;
|
||||
}
|
||||
if (has_post_thumbnail()){
|
||||
return true;
|
||||
@@ -989,7 +990,7 @@ function argon_has_post_thumbnail($postID = 0){
|
||||
function argon_get_post_thumbnail($postID = 0){
|
||||
if ($postID == 0){
|
||||
global $post;
|
||||
$postID = $post->ID;
|
||||
$postID = $post -> ID;
|
||||
}
|
||||
if (has_post_thumbnail()){
|
||||
return apply_filters("argon_post_thumbnail", wp_get_attachment_image_src(get_post_thumbnail_id($postID), "full")[0]);
|
||||
@@ -999,8 +1000,8 @@ function argon_get_post_thumbnail($postID = 0){
|
||||
//文末附加内容
|
||||
function get_additional_content_after_post(){
|
||||
global $post;
|
||||
$postID = $post->ID;
|
||||
$res = get_post_meta($post->ID, 'argon_after_post', true);
|
||||
$postID = $post -> ID;
|
||||
$res = get_post_meta($post -> ID, 'argon_after_post', true);
|
||||
if ($res == "--none--"){
|
||||
return "";
|
||||
}
|
||||
@@ -1133,7 +1134,7 @@ function get_seo_description(){
|
||||
return preg_replace('/ \[…]$/', '…', get_the_excerpt());
|
||||
}
|
||||
if (!post_password_required()){
|
||||
return htmlspecialchars(mb_substr(str_replace("\n", '', strip_tags($post->post_content)), 0, 50)) . "...";
|
||||
return htmlspecialchars(mb_substr(str_replace("\n", '', strip_tags($post -> post_content)), 0, 50)) . "...";
|
||||
}else{
|
||||
return __("这是一个加密页面,需要密码来查看", 'argon');
|
||||
}
|
||||
@@ -1145,14 +1146,14 @@ function get_seo_description(){
|
||||
function get_seo_keywords(){
|
||||
if (is_single()){
|
||||
global $post;
|
||||
$tags = get_the_tags('', ',', '', $post->ID);
|
||||
$tags = get_the_tags('', ',', '', $post -> ID);
|
||||
if ($tags != null){
|
||||
$res = "";
|
||||
foreach ($tags as $tag){
|
||||
if ($res != ""){
|
||||
$res .= ",";
|
||||
}
|
||||
$res .= $tag->name;
|
||||
$res .= $tag -> name;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
@@ -1177,7 +1178,7 @@ function get_seo_keywords(){
|
||||
//页面分享预览图
|
||||
function get_og_image(){
|
||||
global $post;
|
||||
$postID = $post->ID;
|
||||
$postID = $post -> ID;
|
||||
$argon_first_image_as_thumbnail = get_post_meta($postID, 'argon_first_image_as_thumbnail', 'true');
|
||||
if (has_post_thumbnail() || $argon_first_image_as_thumbnail == 'true'){
|
||||
return argon_get_post_thumbnail($postID);
|
||||
@@ -1201,7 +1202,7 @@ function set_post_views(){
|
||||
}
|
||||
if (!isset($post_id)){
|
||||
global $post;
|
||||
$post_id = $post->ID;
|
||||
$post_id = $post -> ID;
|
||||
}
|
||||
if (post_password_required($post_id)){
|
||||
return;
|
||||
@@ -1221,10 +1222,10 @@ function set_post_views(){
|
||||
return;
|
||||
}
|
||||
global $post;
|
||||
if (!isset($post->ID)){
|
||||
if (!isset($post -> ID)){
|
||||
return;
|
||||
}
|
||||
$post_id = $post->ID;
|
||||
$post_id = $post -> ID;
|
||||
$count_key = 'views';
|
||||
$count = get_post_meta($post_id, $count_key, true);
|
||||
if (is_single() || is_page()) {
|
||||
@@ -1315,7 +1316,7 @@ function have_catalog(){
|
||||
if (is_page() && is_page_template('timeline.php')){
|
||||
return true;
|
||||
}
|
||||
$content = get_post(get_the_ID())->post_content;
|
||||
$content = get_post(get_the_ID()) -> post_content;
|
||||
// 检查 HTML 标题标签
|
||||
if (preg_match('/<h[1-6](.*?)>/i', $content)){
|
||||
return true;
|
||||
@@ -1374,7 +1375,7 @@ function get_article_meta($type){
|
||||
if ($type == 'comments'){
|
||||
return '<div class="post-meta-detail post-meta-detail-comments">
|
||||
<i class="fa fa-comments-o" aria-hidden="true"></i> ' .
|
||||
get_post(get_the_ID())->comment_count .
|
||||
get_post(get_the_ID()) -> comment_count .
|
||||
'</div>';
|
||||
}
|
||||
if ($type == 'categories'){
|
||||
@@ -1382,7 +1383,7 @@ function get_article_meta($type){
|
||||
<i class="fa fa-bookmark-o" aria-hidden="true"></i> ';
|
||||
$categories = get_the_category();
|
||||
foreach ($categories as $index => $category){
|
||||
$res .= '<a href="' . get_category_link($category->term_id) . '" target="_blank" class="post-meta-detail-catagory-link">' . $category->cat_name . '</a>';
|
||||
$res .= '<a href="' . get_category_link($category -> term_id) . '" target="_blank" class="post-meta-detail-catagory-link">' . $category -> cat_name . '</a>';
|
||||
if ($index != count($categories) - 1){
|
||||
$res .= '<span class="post-meta-detail-catagory-space">,</span>';
|
||||
}
|
||||
@@ -1394,7 +1395,7 @@ function get_article_meta($type){
|
||||
$res = '<div class="post-meta-detail post-meta-detail-author">
|
||||
<i class="fa fa-user-circle-o" aria-hidden="true"></i> ';
|
||||
global $authordata;
|
||||
$res .= '<a href="' . get_author_posts_url($authordata->ID, $authordata->user_nicename) . '" target="_blank">' . get_the_author() . '</a>
|
||||
$res .= '<a href="' . get_author_posts_url($authordata -> ID, $authordata -> user_nicename) . '" target="_blank">' . get_the_author() . '</a>
|
||||
</div>';
|
||||
return $res;
|
||||
}
|
||||
@@ -1427,7 +1428,7 @@ function is_readingtime_meta_hidden(){
|
||||
return true;
|
||||
}
|
||||
global $post;
|
||||
if (get_post_meta($post->ID, 'argon_hide_readingtime', true) == 'true'){
|
||||
if (get_post_meta($post -> ID, 'argon_hide_readingtime', true) == 'true'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1435,14 +1436,14 @@ function is_readingtime_meta_hidden(){
|
||||
//当前文章是否隐藏 发布时间和分类 (简洁 Meta)
|
||||
function is_meta_simple(){
|
||||
global $post;
|
||||
if (get_post_meta($post->ID, 'argon_meta_simple', true) == 'true'){
|
||||
if (get_post_meta($post -> ID, 'argon_meta_simple', true) == 'true'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//根据文章 id 获取标题
|
||||
function get_post_title_by_id($id){
|
||||
return get_post($id)->post_title;
|
||||
return get_post($id) -> post_title;
|
||||
}
|
||||
//解析 UA 和相应图标
|
||||
require_once(get_template_directory() . '/useragent-parser.php');
|
||||
@@ -1509,14 +1510,14 @@ function check_login_user_same($userid){
|
||||
if ($userid == 0){
|
||||
return false;
|
||||
}
|
||||
if ($userid != (wp_get_current_user()->ID)){
|
||||
if ($userid != (wp_get_current_user() -> ID)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function get_comment_user_id_by_id($comment_ID){
|
||||
$comment = get_comment($comment_ID);
|
||||
return $comment->user_id;
|
||||
return $comment -> user_id;
|
||||
}
|
||||
function check_comment_userid($id){
|
||||
if (!check_login_user_same(get_comment_user_id_by_id($id))){
|
||||
@@ -1546,7 +1547,7 @@ function user_can_view_comment($id){
|
||||
//过滤 RSS 中悄悄话
|
||||
function remove_rss_private_comment_title_and_author($str){
|
||||
global $comment;
|
||||
if (isset($comment->comment_ID) && is_comment_private_mode($comment->comment_ID)){
|
||||
if (isset($comment -> comment_ID) && is_comment_private_mode($comment -> comment_ID)){
|
||||
return "***";
|
||||
}
|
||||
return $str;
|
||||
@@ -1555,9 +1556,9 @@ add_filter('the_title_rss' , 'remove_rss_private_comment_title_and_author');
|
||||
add_filter('comment_author_rss' , 'remove_rss_private_comment_title_and_author');
|
||||
function remove_rss_private_comment_content($str){
|
||||
global $comment;
|
||||
if (is_comment_private_mode($comment->comment_ID)){
|
||||
$comment->comment_content = __('该评论为悄悄话', 'argon');
|
||||
return $comment->comment_content;
|
||||
if (is_comment_private_mode($comment -> comment_ID)){
|
||||
$comment -> comment_content = __('该评论为悄悄话', 'argon');
|
||||
return $comment -> comment_content;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
@@ -1567,11 +1568,11 @@ function get_comment_parent_info($comment){
|
||||
if (!$GLOBALS['argon_comment_options']['show_comment_parent_info']){
|
||||
return "";
|
||||
}
|
||||
if ($comment->comment_parent == 0){
|
||||
if ($comment -> comment_parent == 0){
|
||||
return "";
|
||||
}
|
||||
$parent_comment = get_comment($comment->comment_parent);
|
||||
return '<div class="comment-parent-info" data-parent-id=' . $parent_comment->comment_ID . '><i class="fa fa-reply" aria-hidden="true"></i> ' . get_comment_author($parent_comment->comment_ID) . '</div>';
|
||||
$parent_comment = get_comment($comment -> comment_parent);
|
||||
return '<div class="comment-parent-info" data-parent-id=' . $parent_comment -> comment_ID . '><i class="fa fa-reply" aria-hidden="true"></i> ' . get_comment_author($parent_comment -> comment_ID) . '</div>';
|
||||
}
|
||||
//是否可以查看评论编辑记录
|
||||
function can_visit_comment_edit_history($id){
|
||||
@@ -1617,10 +1618,10 @@ function get_comment_edit_history(){
|
||||
<div class='comment-edit-history-id'>
|
||||
#" . $position . "
|
||||
</div>
|
||||
" . ($edition->isfirst ? "<span class='badge badge-primary badge-admin'>" . __("最初版本", 'argon') . "</span>" : "") . "
|
||||
" . ($edition -> isfirst ? "<span class='badge badge-primary badge-admin'>" . __("最初版本", 'argon') . "</span>" : "") . "
|
||||
</div>
|
||||
<div class='comment-edit-history-time'>" . date('Y-m-d H:i:s', $edition->time) . "</div>
|
||||
<div class='comment-edit-history-content'>" . str_replace("\n", "</br>", $edition->content) . "</div>
|
||||
<div class='comment-edit-history-time'>" . date('Y-m-d H:i:s', $edition -> time) . "</div>
|
||||
<div class='comment-edit-history-content'>" . str_replace("\n", "</br>", $edition -> content) . "</div>
|
||||
</div>";
|
||||
}
|
||||
exit(json_encode(array(
|
||||
@@ -1632,10 +1633,10 @@ add_action('wp_ajax_get_comment_edit_history', 'get_comment_edit_history');
|
||||
add_action('wp_ajax_nopriv_get_comment_edit_history', 'get_comment_edit_history');
|
||||
//是否可以置顶/取消置顶
|
||||
function is_comment_pinable($id){
|
||||
if (get_comment($id)->comment_approved != "1"){
|
||||
if (get_comment($id) -> comment_approved != "1"){
|
||||
return false;
|
||||
}
|
||||
if (get_comment($id)->comment_parent != 0){
|
||||
if (get_comment($id) -> comment_parent != 0){
|
||||
return false;
|
||||
}
|
||||
if (is_comment_private_mode($id)){
|
||||
@@ -1659,7 +1660,7 @@ function argon_get_comment_text($comment_ID = 0, $args = array()) {
|
||||
);
|
||||
$comment_text = preg_replace(
|
||||
'/<img src="(.*?)" alt="(.*?)" \/>/',
|
||||
'<a href="$1" title="$2" data-fancybox="comment-' . $comment->comment_ID . '-image" class="comment-image" rel="nofollow">
|
||||
'<a href="$1" title="$2" data-fancybox="comment-' . $comment -> comment_ID . '-image" class="comment-image" rel="nofollow">
|
||||
<i class="fa fa-image" aria-hidden="true"></i>
|
||||
' . __('查看图片', 'argon') . '
|
||||
<img src="" alt="$2" class="comment-image-preview">
|
||||
@@ -1694,7 +1695,7 @@ function get_comment_upvotes($id) {
|
||||
if ($comment == null){
|
||||
return 0;
|
||||
}
|
||||
$upvotes = get_comment_meta($comment->comment_ID, "upvotes", true);
|
||||
$upvotes = get_comment_meta($comment -> comment_ID, "upvotes", true);
|
||||
if ($upvotes == null) {
|
||||
$upvotes = 0;
|
||||
}
|
||||
@@ -1705,12 +1706,12 @@ function set_comment_upvotes($id){
|
||||
if ($comment == null){
|
||||
return 0;
|
||||
}
|
||||
$upvotes = get_comment_meta($comment->comment_ID, "upvotes", true);
|
||||
$upvotes = get_comment_meta($comment -> comment_ID, "upvotes", true);
|
||||
if ($upvotes == null) {
|
||||
$upvotes = 0;
|
||||
}
|
||||
$upvotes++;
|
||||
update_comment_meta($comment->comment_ID, "upvotes", $upvotes);
|
||||
update_comment_meta($comment -> comment_ID, "upvotes", $upvotes);
|
||||
return $upvotes;
|
||||
}
|
||||
function is_comment_upvoted($id){
|
||||
@@ -1767,7 +1768,7 @@ $GLOBALS['argon_comment_options']['show_comment_parent_info'] = (get_option("arg
|
||||
function argon_comment_format($comment, $args, $depth){
|
||||
global $comment_enable_upvote, $comment_enable_pinning;
|
||||
$GLOBALS['comment'] = $comment;
|
||||
if (!($comment->placeholder) && user_can_view_comment(get_comment_ID())){
|
||||
if (!($comment -> placeholder) && user_can_view_comment(get_comment_ID())){
|
||||
?>
|
||||
<li class="comment-item" id="comment-<?php comment_ID(); ?>" data-id="<?php comment_ID(); ?>" data-use-markdown="<?php echo get_comment_meta(get_comment_ID(), "use_markdown", true);?>">
|
||||
<div class="comment-item-left-wrapper">
|
||||
@@ -1789,7 +1790,7 @@ function argon_comment_format($comment, $args, $depth){
|
||||
<div class="comment-item-title">
|
||||
<div class="comment-name">
|
||||
<div class="comment-author"><?php echo get_comment_author_link();?></div>
|
||||
<?php if (user_can($comment->user_id , "update_core")){
|
||||
<?php if (user_can($comment -> user_id , "update_core")){
|
||||
echo '<span class="badge badge-primary badge-admin">' . __('博主', 'argon') . '</span>';}
|
||||
?>
|
||||
<?php echo get_comment_parent_info($comment); ?>
|
||||
@@ -1799,11 +1800,11 @@ function argon_comment_format($comment, $args, $depth){
|
||||
<?php if (is_comment_private_mode(get_comment_ID()) && user_can_view_comment(get_comment_ID())){
|
||||
echo '<span class="badge badge-success badge-private-comment">' . __('悄悄话', 'argon') . '</span>';}
|
||||
?>
|
||||
<?php if ($comment->comment_approved == 0){
|
||||
<?php if ($comment -> comment_approved == 0){
|
||||
echo '<span class="badge badge-warning badge-unapproved">' . __('待审核', 'argon') . '</span>';}
|
||||
?>
|
||||
<?php
|
||||
echo parse_ua_and_icon($comment->comment_agent);
|
||||
echo parse_ua_and_icon($comment -> comment_agent);
|
||||
?>
|
||||
</div>
|
||||
<div class="comment-info">
|
||||
@@ -1831,7 +1832,7 @@ function argon_comment_format($comment, $args, $depth){
|
||||
<button class="comment-pin btn btn-sm btn-outline-primary" data-id="<?php comment_ID(); ?>" type="button" style="margin-right: 2px;"><?php _ex('置顶', 'to pin', 'argon')?></button>
|
||||
<?php }
|
||||
} ?>
|
||||
<?php if ((check_comment_token(get_comment_ID()) || check_login_user_same($comment->user_id)) && (get_option("argon_comment_allow_editing") != "false")) { ?>
|
||||
<?php if ((check_comment_token(get_comment_ID()) || check_login_user_same($comment -> user_id)) && (get_option("argon_comment_allow_editing") != "false")) { ?>
|
||||
<button class="comment-edit btn btn-sm btn-outline-primary" data-id="<?php comment_ID(); ?>" type="button" style="margin-right: 2px;"><?php _e('编辑', 'argon')?></button>
|
||||
<?php } ?>
|
||||
<button class="comment-reply btn btn-sm btn-outline-primary" data-id="<?php comment_ID(); ?>" type="button"><?php _e('回复', 'argon')?></button>
|
||||
@@ -1848,10 +1849,10 @@ function argon_comment_shuoshuo_preview_format($comment, $args, $depth){
|
||||
<div class="comment-item-inner " id="comment-inner-<?php comment_ID();?>">
|
||||
<span class="shuoshuo-comment-item-title">
|
||||
<?php echo get_comment_author_link();?>
|
||||
<?php if( user_can($comment->user_id , "update_core") ){
|
||||
<?php if( user_can($comment -> user_id , "update_core") ){
|
||||
echo '<span class="badge badge-primary badge-admin">' . __('博主', 'argon') . '</span>';}
|
||||
?>
|
||||
<?php if( $comment->comment_approved == 0 ){
|
||||
<?php if( $comment -> comment_approved == 0 ){
|
||||
echo '<span class="badge badge-warning badge-unapproved">' . __('待审核', 'argon') . '</span>';}
|
||||
?>
|
||||
:
|
||||
@@ -1885,10 +1886,10 @@ get_comment_captcha_seed();
|
||||
class captcha_calculation{ //数字验证码
|
||||
var $captchaSeed;
|
||||
function __construct($seed) {
|
||||
$this->captchaSeed = $seed;
|
||||
$this -> captchaSeed = $seed;
|
||||
}
|
||||
function getChallenge(){
|
||||
mt_srand($this->captchaSeed + 10007);
|
||||
mt_srand($this -> captchaSeed + 10007);
|
||||
$oper = mt_rand(1 , 4);
|
||||
$num1 = 0;
|
||||
$num2 = 0;
|
||||
@@ -1918,7 +1919,7 @@ class captcha_calculation{ //数字验证码
|
||||
}
|
||||
}
|
||||
function getAnswer(){
|
||||
mt_srand($this->captchaSeed + 10007);
|
||||
mt_srand($this -> captchaSeed + 10007);
|
||||
$oper = mt_rand(1 , 4);
|
||||
$num1 = 0;
|
||||
$num2 = 0;
|
||||
@@ -1966,11 +1967,11 @@ function wrong_captcha($msg = null){
|
||||
}
|
||||
function get_comment_captcha(){
|
||||
$captcha = new captcha_calculation(get_comment_captcha_seed());
|
||||
return $captcha->getChallenge();
|
||||
return $captcha -> getChallenge();
|
||||
}
|
||||
function get_comment_captcha_answer(){
|
||||
$captcha = new captcha_calculation(get_comment_captcha_seed());
|
||||
return $captcha->getAnswer();
|
||||
return $captcha -> getAnswer();
|
||||
}
|
||||
// Geetest 验证码相关函数
|
||||
function geetest_validate($lot_number, $captcha_output, $pass_token, $gen_time) {
|
||||
@@ -2322,9 +2323,9 @@ function ajax_post_comment(){
|
||||
}
|
||||
$comment = wp_handle_comment_submission(wp_unslash($_POST));
|
||||
if (is_wp_error($comment)){
|
||||
$msg = $comment->get_error_data();
|
||||
$msg = $comment -> get_error_data();
|
||||
if (!empty($msg)){
|
||||
$msg = $comment->get_error_message();
|
||||
$msg = $comment -> get_error_message();
|
||||
}
|
||||
exit(json_encode(array(
|
||||
'status' => 'failed',
|
||||
@@ -2337,7 +2338,7 @@ function ajax_post_comment(){
|
||||
if (isset($_POST['qq'])){
|
||||
if (!empty($_POST['qq']) && get_option('argon_comment_enable_qq_avatar') == 'true'){
|
||||
$_comment = $comment;
|
||||
$_comment->comment_author_email = $_POST['qq'] . "@avatarqq.com";
|
||||
$_comment -> comment_author_email = $_POST['qq'] . "@avatarqq.com";
|
||||
do_action('set_comment_cookies', $_comment, $user);
|
||||
}
|
||||
}
|
||||
@@ -2359,8 +2360,8 @@ function ajax_post_comment(){
|
||||
exit(json_encode(array(
|
||||
'status' => 'success',
|
||||
'html' => $html,
|
||||
'id' => $comment->comment_ID,
|
||||
'parentID' => $comment->comment_parent,
|
||||
'id' => $comment -> comment_ID,
|
||||
'parentID' => $comment -> comment_parent,
|
||||
'commentOrder' => (get_option("comment_order") == "" ? "desc" : get_option("comment_order")),
|
||||
'newCaptchaSeed' => $newCaptchaSeed,
|
||||
'newCaptcha' => $newCaptcha,
|
||||
@@ -2392,7 +2393,7 @@ function comment_markdown_parse($comment_content){
|
||||
|
||||
//解析 Markdown
|
||||
$parsedown = new _Parsedown();
|
||||
$res = $parsedown->text($comment_content);
|
||||
$res = $parsedown -> text($comment_content);
|
||||
/*$res = preg_replace(
|
||||
'/<code>([\s\S]*?)<\/code>/',
|
||||
'<pre>$1</pre>',
|
||||
@@ -2498,16 +2499,16 @@ function comment_mail_notify($comment){
|
||||
if ($comment == null){
|
||||
return;
|
||||
}
|
||||
$id = $comment->comment_ID;
|
||||
$commentPostID = $comment->comment_post_ID;
|
||||
$commentAuthor = $comment->comment_author;
|
||||
$parentID = $comment->comment_parent;
|
||||
$id = $comment -> comment_ID;
|
||||
$commentPostID = $comment -> comment_post_ID;
|
||||
$commentAuthor = $comment -> comment_author;
|
||||
$parentID = $comment -> comment_parent;
|
||||
if ($parentID == 0){
|
||||
return;
|
||||
}
|
||||
$parentComment = get_comment($parentID);
|
||||
$parentEmail = $parentComment->comment_author_email;
|
||||
$parentName = $parentComment->comment_author;
|
||||
$parentEmail = $parentComment -> comment_author_email;
|
||||
$parentName = $parentComment -> comment_author;
|
||||
$emailTo = "$parentName <$parentEmail>";
|
||||
if (get_comment_meta($parentID, "enable_mailnotice", true) == "true"){
|
||||
if (check_email_address($parentEmail)){
|
||||
@@ -2554,8 +2555,8 @@ add_action('argon_async_comment_mail_notify', 'argon_async_comment_mail_notify_h
|
||||
function post_comment_updatemetas($id){
|
||||
$parentID = $_POST['comment_parent'];
|
||||
$comment = get_comment($id);
|
||||
$commentPostID = $comment->comment_post_ID;
|
||||
$commentAuthor = $comment->comment_author;
|
||||
$commentPostID = $comment -> comment_post_ID;
|
||||
$commentAuthor = $comment -> comment_author;
|
||||
$mailnoticeUnsubscribeKey = get_random_token();
|
||||
//评论 Markdown 源码
|
||||
update_comment_meta($id, "comment_content_source", $_POST['comment_content_source']);
|
||||
@@ -2597,7 +2598,7 @@ function post_comment_updatemetas($id){
|
||||
update_comment_meta($id, "enable_mailnotice", "false");
|
||||
}
|
||||
//向父级评论发送邮件
|
||||
if ($comment->comment_approved == 1){
|
||||
if ($comment -> comment_approved == 1){
|
||||
wp_schedule_single_event(time() + 1, 'argon_async_comment_mail_notify', array($comment->comment_ID));
|
||||
}
|
||||
//保存 QQ 号
|
||||
@@ -2696,7 +2697,7 @@ function pin_comment(){
|
||||
'msg' => $newPinnedStat ? __('评论已经是置顶状态', 'argon') : __('评论已经是取消置顶状态', 'argon')
|
||||
)));
|
||||
}
|
||||
if (get_comment($id)->comment_parent != 0){
|
||||
if (get_comment($id) -> comment_parent != 0){
|
||||
exit(json_encode(array(
|
||||
'status' => 'failed',
|
||||
'msg' => __('不能置顶子评论', 'argon')
|
||||
@@ -2836,8 +2837,8 @@ function get_argon_comment_paginate_links_prev_url(){
|
||||
//评论重排序(置顶优先)
|
||||
$GLOBALS['comment_order'] = get_option('comment_order');
|
||||
function argon_comment_cmp($a, $b){
|
||||
$a_pinned = get_comment_meta($a->comment_ID, 'pinned', true);
|
||||
$b_pinned = get_comment_meta($b->comment_ID, 'pinned', true);
|
||||
$a_pinned = get_comment_meta($a -> comment_ID, 'pinned', true);
|
||||
$b_pinned = get_comment_meta($b -> comment_ID, 'pinned', true);
|
||||
if ($a_pinned != "true"){
|
||||
$a_pinned = "false";
|
||||
}
|
||||
@@ -2845,7 +2846,7 @@ function argon_comment_cmp($a, $b){
|
||||
$b_pinned = "false";
|
||||
}
|
||||
if ($a_pinned == $b_pinned){
|
||||
return ($a->comment_date_gmt) > ($b->comment_date_gmt);
|
||||
return ($a -> comment_date_gmt) > ($b -> comment_date_gmt);
|
||||
}else{
|
||||
if ($a_pinned == "true"){
|
||||
return ($GLOBALS['comment_order'] == 'desc');
|
||||
@@ -2857,7 +2858,7 @@ function argon_comment_cmp($a, $b){
|
||||
function argon_get_comments(){
|
||||
global $wp_query;
|
||||
/*$cpage = get_query_var('cpage') ?? 1;
|
||||
$maxiumPages = $wp_query->max_num_pages;*/
|
||||
$maxiumPages = $wp_query -> max_num_pages;*/
|
||||
$args = array(
|
||||
'post__in' => array(get_the_ID()),
|
||||
'type' => 'comment',
|
||||
@@ -2875,7 +2876,7 @@ function argon_get_comments(){
|
||||
}
|
||||
|
||||
$comment_query = new WP_Comment_Query;
|
||||
$comments = $comment_query->query($args);
|
||||
$comments = $comment_query -> query($args);
|
||||
|
||||
if (get_option("argon_enable_comment_pinning", "false") == "true"){
|
||||
usort($comments, "argon_comment_cmp");
|
||||
@@ -2893,7 +2894,7 @@ function argon_get_comments(){
|
||||
$comments_per_page = get_option('comments_per_page');
|
||||
$comments_count = 0;
|
||||
foreach ($comments as $comment){
|
||||
if ($comment->comment_parent == 0){
|
||||
if ($comment -> comment_parent == 0){
|
||||
$comments_count++;
|
||||
}
|
||||
}
|
||||
@@ -2911,10 +2912,10 @@ function argon_get_comments(){
|
||||
//QQ Avatar 获取
|
||||
function get_avatar_by_qqnumber($avatar){
|
||||
global $comment;
|
||||
if (!isset($comment) || !isset($comment->comment_ID)){
|
||||
if (!isset($comment) || !isset($comment -> comment_ID)){
|
||||
return $avatar;
|
||||
}
|
||||
$qqnumber = get_comment_meta($comment->comment_ID, 'qq_number', true);
|
||||
$qqnumber = get_comment_meta($comment -> comment_ID, 'qq_number', true);
|
||||
if (!empty($qqnumber)){
|
||||
preg_match_all('/width=\'(.*?)\'/', $avatar, $preg_res);
|
||||
$size = $preg_res[1][0];
|
||||
@@ -2976,7 +2977,7 @@ function the_content_filter($content){
|
||||
$content = argon_fancybox($content);
|
||||
}
|
||||
global $post;
|
||||
$custom_css = get_post_meta($post->ID, 'argon_custom_css', true);
|
||||
$custom_css = get_post_meta($post -> ID, 'argon_custom_css', true);
|
||||
if (!empty($custom_css)){
|
||||
$content .= "<style>" . $custom_css . "</style>";
|
||||
}
|
||||
@@ -3065,7 +3066,7 @@ function alert_footer_copyright_changed(){ ?>
|
||||
</div>
|
||||
<?php }
|
||||
function check_footer_copyright(){
|
||||
$footer = file_get_contents(get_theme_root() . "/" . wp_get_theme()->template . "/footer.php");
|
||||
$footer = file_get_contents(get_theme_root() . "/" . wp_get_theme() -> template . "/footer.php");
|
||||
if ((strpos($footer, "github.com/solstice23/argon-theme") === false) && (strpos($footer, "solstice23.top") === false)){
|
||||
add_action('admin_notices', 'alert_footer_copyright_changed');
|
||||
}
|
||||
@@ -3370,8 +3371,8 @@ add_action('wp_ajax_update_post_meta_ajax' , 'update_post_meta_ajax');
|
||||
add_action('wp_ajax_nopriv_update_post_meta_ajax' , 'update_post_meta_ajax');
|
||||
//首页显示说说
|
||||
function argon_home_add_post_type_shuoshuo($query){
|
||||
if (is_home() && $query->is_main_query()){
|
||||
$query->set('post_type', array('post', 'shuoshuo'));
|
||||
if (is_home() && $query -> is_main_query()){
|
||||
$query -> set('post_type', array('post', 'shuoshuo'));
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
@@ -3380,11 +3381,11 @@ if (get_option("argon_home_show_shuoshuo") == "true"){
|
||||
}
|
||||
//首页隐藏特定分类文章
|
||||
function argon_home_hide_categories($query){
|
||||
if (is_home() && $query->is_main_query()){
|
||||
if (is_home() && $query -> is_main_query()){
|
||||
$excludeCategories = explode(",", get_option("argon_hide_categories"));
|
||||
$excludeCategories = array_map(function($cat) { return -$cat; }, $excludeCategories);
|
||||
$query->set('category__not_in', $excludeCategories);
|
||||
$query->set('tag__not_in', $excludeCategories);
|
||||
$query -> set('category__not_in', $excludeCategories);
|
||||
$query -> set('tag__not_in', $excludeCategories);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
@@ -3394,7 +3395,7 @@ if (get_option("argon_hide_categories") != ""){
|
||||
//文章过时信息显示
|
||||
function argon_get_post_outdated_info(){
|
||||
global $post;
|
||||
$post_show_outdated_info_status = strval(get_post_meta($post->ID, 'argon_show_post_outdated_info', true));
|
||||
$post_show_outdated_info_status = strval(get_post_meta($post -> ID, 'argon_show_post_outdated_info', true));
|
||||
if (get_option("argon_outdated_info_tip_type") == "toast"){
|
||||
$before = "<div id='post_outdate_toast' style='display:none;' data-text='";
|
||||
$after = "'></div>";
|
||||
@@ -3730,25 +3731,25 @@ function shortcode_friend_link($attr,$content=""){
|
||||
foreach ($friendlinks as $friendlink){
|
||||
$out .= "
|
||||
<div class='link mb-2 col-lg-6 col-md-6'>
|
||||
<div class='card shadow-sm friend-link-container" . ($friendlink->link_image == "" ? " no-avatar" : "") . "'>";
|
||||
if ($friendlink->link_image != ''){
|
||||
<div class='card shadow-sm friend-link-container" . ($friendlink -> link_image == "" ? " no-avatar" : "") . "'>";
|
||||
if ($friendlink -> link_image != ''){
|
||||
$out .= "
|
||||
<img src='" . $friendlink->link_image . "' class='friend-link-avatar bg-gradient-secondary'>";
|
||||
<img src='" . $friendlink -> link_image . "' class='friend-link-avatar bg-gradient-secondary'>";
|
||||
}
|
||||
$out .= " <div class='friend-link-content'>
|
||||
<div class='friend-link-title title text-primary'>
|
||||
<a target='_blank' href='" . esc_url($friendlink->link_url) . "'>" . esc_html($friendlink->link_name) . "</a>
|
||||
<a target='_blank' href='" . esc_url($friendlink -> link_url) . "'>" . esc_html($friendlink -> link_name) . "</a>
|
||||
</div>
|
||||
<div class='friend-link-description'>" . esc_html($friendlink->link_description) . "</div>";
|
||||
<div class='friend-link-description'>" . esc_html($friendlink -> link_description) . "</div>";
|
||||
$out .= " <div class='friend-link-links'>";
|
||||
foreach (explode("\n", $friendlink->link_notes) as $line){
|
||||
foreach (explode("\n", $friendlink -> link_notes) as $line){
|
||||
$item = explode("|", trim($line));
|
||||
if(stripos($item[0], "fa-") !== 0){
|
||||
continue;
|
||||
}
|
||||
$out .= "<a href='" . esc_url($item[1]) . "' target='_blank'><i class='fa " . sanitize_html_class($item[0]) . "'></i></a>";
|
||||
}
|
||||
$out .= "<a href='" . esc_url($friendlink->link_url) . "' target='_blank' style='float:right; margin-right: 10px;'><i class='fa fa-angle-right' style='font-weight: bold;'></i></a>";
|
||||
$out .= "<a href='" . esc_url($friendlink -> link_url) . "' target='_blank' style='float:right; margin-right: 10px;'><i class='fa fa-angle-right' style='font-weight: bold;'></i></a>";
|
||||
$out .= "
|
||||
</div>
|
||||
</div>
|
||||
@@ -3928,12 +3929,12 @@ function shortcode_github($attr,$content=""){
|
||||
throw new Exception("");
|
||||
}
|
||||
$json = json_decode($json);
|
||||
$description = esc_html($json->description);
|
||||
if (!empty($json->homepage)){
|
||||
$description .= esc_html(" <a href='" . $json->homepage . "' target='_blank' no-pjax>" . $json->homepage . "</a>");
|
||||
$description = esc_html($json -> description);
|
||||
if (!empty($json -> homepage)){
|
||||
$description .= esc_html(" <a href='" . $json -> homepage . "' target='_blank' no-pjax>" . $json -> homepage . "</a>");
|
||||
}
|
||||
$stars = $json->stargazers_count;
|
||||
$forks = $json->forks_count;
|
||||
$stars = $json -> stargazers_count;
|
||||
$forks = $json -> forks_count;
|
||||
}catch (Exception $e){
|
||||
$getdata = "frontend";
|
||||
}
|
||||
@@ -4235,13 +4236,13 @@ function argon_get_search_post_type_array(){
|
||||
return $arr;
|
||||
}
|
||||
function search_filter($query) {
|
||||
if (!$query->is_search || is_admin()) {
|
||||
if (!$query -> is_search || is_admin()) {
|
||||
return $query;
|
||||
}
|
||||
if (get_option('argon_enable_search_filters', 'true') == 'false'){
|
||||
return $query;
|
||||
}
|
||||
$query->set('post_type', argon_get_search_post_type_array());
|
||||
$query -> set('post_type', argon_get_search_post_type_array());
|
||||
return $query;
|
||||
}
|
||||
add_filter('pre_get_posts', 'search_filter');
|
||||
@@ -4287,6 +4288,7 @@ function argon_enqueue_qrcode_script() {
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'argon_enqueue_qrcode_script');
|
||||
|
||||
|
||||
// 获取 Git 版本信息
|
||||
function argon_get_git_info() {
|
||||
$theme_dir = get_template_directory();
|
||||
@@ -4351,6 +4353,7 @@ function argon_get_git_info() {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ========== TODO 列表功能 ==========
|
||||
|
||||
// 获取 TODO 列表
|
||||
|
||||
79
header.php
79
header.php
@@ -196,7 +196,9 @@
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$seo_keywords = get_seo_keywords();
|
||||
|
||||
@@ -206,7 +208,9 @@
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if (is_single() || is_page()){
|
||||
|
||||
@@ -228,7 +232,9 @@
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<meta name="theme-color" content="<?php echo $themecolor; ?>">
|
||||
|
||||
|
||||
<meta name="theme-color" content="<?php echo $themecolor; ?>">
|
||||
|
||||
<meta name="theme-color-rgb" content="<?php echo hex2str($themecolor); ?>">
|
||||
|
||||
@@ -236,13 +242,21 @@
|
||||
|
||||
<meta name="argon-enable-custom-theme-color" content="<?php echo (get_option('argon_show_customize_theme_color_picker') != 'false' ? 'true' : 'false'); ?>">
|
||||
|
||||
<meta name="theme-card-radius" content="<?php echo $cardradius; ?>">
|
||||
|
||||
|
||||
|
||||
|
||||
<meta name="theme-card-radius" content="<?php echo $cardradius; ?>">
|
||||
|
||||
<meta name="theme-card-radius-origin" content="<?php echo $cardradius_origin; ?>">
|
||||
|
||||
<meta name="theme-version" content="<?php echo $GLOBALS['theme_version']; ?>">
|
||||
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
|
||||
<meta name="theme-version" content="<?php echo $GLOBALS['theme_version']; ?>">
|
||||
|
||||
|
||||
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
|
||||
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
|
||||
|
||||
@@ -279,7 +293,8 @@
|
||||
<?php wp_head(); ?>
|
||||
|
||||
<?php if (function_exists('argon_is_force_refresh_enabled') && argon_is_force_refresh_enabled()): ?>
|
||||
<!-- 强制刷新缓存 - 清除浏览器和 Service Worker 缓存 --><script>
|
||||
<!-- 强制刷新缓存 - 清除浏览器和 Service Worker 缓存 -->
|
||||
<script>
|
||||
(function() {
|
||||
var forceRefreshKey = 'argon_force_refresh_version';
|
||||
var currentVersion = '<?php echo get_option('argon_force_refresh_enabled_time', 0); ?>';
|
||||
@@ -322,7 +337,8 @@
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 移动端资源加载修复 - 确保 CSS 完全应用 --><script>
|
||||
<!-- 移动端资源加载修复 - 确保 CSS 完全应用 -->
|
||||
<script>
|
||||
(function() {
|
||||
// 检测移动端并强制重新计算样式
|
||||
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
||||
@@ -354,7 +370,8 @@
|
||||
window.argonUserRole = '<?php echo current_user_can('administrator') ? 'administrator' : (is_user_logged_in() ? 'user' : 'guest'); ?>';
|
||||
</script>
|
||||
|
||||
<!-- Argon 修复补丁 - 必须在 wp_head() 之后立即执行 --><script src="<?php echo get_template_directory_uri(); ?>/assets/js/argon.min.js?ver=<?php echo $assets_version; ?>"></script>
|
||||
<!-- Argon 修复补丁 - 必须在 wp_head() 之后立即执行 -->
|
||||
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/argon.min.js?ver=<?php echo $assets_version; ?>"></script>
|
||||
|
||||
<?php $GLOBALS['wp_path'] = get_option('argon_wp_path') == '' ? '/' : get_option('argon_wp_path'); ?>
|
||||
|
||||
@@ -548,7 +565,9 @@
|
||||
|
||||
}
|
||||
|
||||
function toggleAmoledDarkMode(){
|
||||
|
||||
|
||||
function toggleAmoledDarkMode(){
|
||||
|
||||
document.documentElement.classList.toggle("amoled-dark");
|
||||
|
||||
@@ -586,7 +605,9 @@ function toggleAmoledDarkMode(){
|
||||
|
||||
</script>
|
||||
|
||||
<?php if (get_option('argon_enable_smoothscroll_type') == '2') { /*平滑滚动*/?>
|
||||
|
||||
|
||||
<?php if (get_option('argon_enable_smoothscroll_type') == '2') { /*平滑滚动*/?>
|
||||
|
||||
<script src="<?php echo $GLOBALS['assets_path']; ?>/assets/vendor/smoothscroll/smoothscroll2.js"></script>
|
||||
|
||||
@@ -606,8 +627,12 @@ function toggleAmoledDarkMode(){
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<?php echo get_option('argon_custom_html_head'); ?>
|
||||
|
||||
|
||||
|
||||
<style id="themecolor_css">
|
||||
|
||||
<?php
|
||||
@@ -745,6 +770,8 @@ if ($animation_style == 'apple') {
|
||||
<?php endif; ?>
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<body <?php body_class(); ?>>
|
||||
|
||||
<?php /*wp_body_open();*/ ?>
|
||||
@@ -855,17 +882,17 @@ if ($animation_style == 'apple') {
|
||||
|
||||
if ($depth == 0){
|
||||
|
||||
if ($args->walker->has_children == 1){
|
||||
if ($args -> walker -> has_children == 1){
|
||||
|
||||
$output .= "\n
|
||||
|
||||
<li class='nav-item dropdown'>
|
||||
|
||||
<a href='" . $object->url . "' class='nav-link' data-toggle='dropdown' no-pjax onclick='return false;' title='" . $object->description . "'>
|
||||
<a href='" . $object -> url . "' class='nav-link' data-toggle='dropdown' no-pjax onclick='return false;' title='" . $object -> description . "'>
|
||||
|
||||
<i class='ni ni-book-bookmark d-lg-none'></i>
|
||||
|
||||
<span class='nav-link-inner--text'>" . $object->title . "</span>
|
||||
<span class='nav-link-inner--text'>" . $object -> title . "</span>
|
||||
|
||||
</a>";
|
||||
|
||||
@@ -875,11 +902,11 @@ if ($animation_style == 'apple') {
|
||||
|
||||
<li class='nav-item'>
|
||||
|
||||
<a href='" . $object->url . "' class='nav-link' target='" . $object->target . "' title='" . $object->description . "'>
|
||||
<a href='" . $object -> url . "' class='nav-link' target='" . $object -> target . "' title='" . $object -> description . "'>
|
||||
|
||||
<i class='ni ni-book-bookmark d-lg-none'></i>
|
||||
|
||||
<span class='nav-link-inner--text'>" . $object->title . "</span>
|
||||
<span class='nav-link-inner--text'>" . $object -> title . "</span>
|
||||
|
||||
</a>";
|
||||
|
||||
@@ -887,7 +914,7 @@ if ($animation_style == 'apple') {
|
||||
|
||||
}else if ($depth == 1){
|
||||
|
||||
$output .= "<a href='" . $object->url . "' class='dropdown-item' target='" . $object->target . "' title='" . $object->description . "'>" . $object->title . "</a>";
|
||||
$output .= "<a href='" . $object -> url . "' class='dropdown-item' target='" . $object -> target . "' title='" . $object -> description . "'>" . $object -> title . "</a>";
|
||||
|
||||
}
|
||||
|
||||
@@ -1037,7 +1064,9 @@ if ($animation_style == 'apple') {
|
||||
|
||||
</div>
|
||||
|
||||
<!--Banner--><section id="banner" class="banner section section-lg section-shaped">
|
||||
<!--Banner-->
|
||||
|
||||
<section id="banner" class="banner section section-lg section-shaped">
|
||||
|
||||
<div class="shape <?php echo get_option('argon_banner_background_hide_shapes') == 'true' ? '' : 'shape-style-1' ?> <?php echo get_option('argon_banner_background_color_type') == '' ? 'shape-primary' : get_option('argon_banner_background_color_type'); ?>">
|
||||
|
||||
@@ -1061,7 +1090,9 @@ if ($animation_style == 'apple') {
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$banner_title = get_option('argon_banner_title') == '' ? get_bloginfo('name') : get_option('argon_banner_title');
|
||||
|
||||
@@ -1113,6 +1144,8 @@ if ($animation_style == 'apple') {
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<?php if (apply_filters('argon_page_background_url', get_option('argon_page_background_url')) != '') { ?>
|
||||
|
||||
<style>
|
||||
@@ -1253,7 +1286,8 @@ if ($animation_style == 'apple') {
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- 毛玻璃效果 - 独立于背景图片设置(无背景图时也生效) --><?php
|
||||
<!-- 毛玻璃效果 - 独立于背景图片设置(无背景图时也生效) -->
|
||||
<?php
|
||||
$card_blur_standalone = intval(get_option('argon_card_blur', '20'));
|
||||
$card_saturate_standalone = intval(get_option('argon_card_saturate', '180'));
|
||||
$post_bg_opacity_standalone = get_option('argon_post_background_opacity', '0.7');
|
||||
@@ -1294,6 +1328,7 @@ if (apply_filters('argon_page_background_url', get_option('argon_page_background
|
||||
</style>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if (get_option('argon_show_toolbar_mask') == 'true') { ?>
|
||||
|
||||
<style>
|
||||
@@ -1330,6 +1365,8 @@ if (apply_filters('argon_page_background_url', get_option('argon_page_background
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
<div id="float_action_buttons" class="float-action-buttons fabtns-unloaded">
|
||||
|
||||
<button id="fabtn_toggle_sides" class="btn btn-icon btn-neutral fabtn shadow-sm" type="button" aria-hidden="true" tooltip-move-to-left="<?php _e('移至左侧', 'argon'); ?>" tooltip-move-to-right="<?php _e('移至右侧', 'argon'); ?>">
|
||||
@@ -1476,5 +1513,7 @@ if (apply_filters('argon_page_background_url', get_option('argon_page_background
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="content" class="site-content">
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
if ($filter_type[0] == '*'){ $filter_type = substr($filter_type, 1); }
|
||||
$checked = in_array($filter_type, $current_filters_type);
|
||||
if (isset($all_post_types[$filter_type])){
|
||||
$filter_name = $all_post_types[$filter_type]->labels->name;
|
||||
$filter_name = $all_post_types[$filter_type] -> labels -> name;
|
||||
?>
|
||||
<div class="custom-control custom-checkbox search-filter-wrapper">
|
||||
<input class="custom-control-input search-filter" name="<?php echo $filter_type; ?>" id="search_filter_<?php echo $filter_type; ?>" type="checkbox" <?php echo $checked ? 'checked="true"' : ''; ?>>
|
||||
@@ -38,7 +38,7 @@
|
||||
<?php } ?>
|
||||
<p class="text-black mt-3 mb-0 opacity-8">
|
||||
<i class="fa fa-file-o mr-1"></i>
|
||||
<?php global $wp_query; echo $wp_query->found_posts; ?> <?php _e('个结果', 'argon');?>
|
||||
<?php global $wp_query; echo $wp_query -> found_posts; ?> <?php _e('个结果', 'argon');?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
176
settings.php
176
settings.php
@@ -90,7 +90,8 @@ function themeoptions_page(){
|
||||
|
||||
<tbody>
|
||||
|
||||
<!-- ========== 1. 基础设置 ========== --><tr><th class="subtitle"><h2 id="section-basic"><?php _e("基础设置", 'argon');?></h2></th></tr>
|
||||
<!-- ========== 1. 基础设置 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-basic"><?php _e("基础设置", 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-theme-color"><?php _e("主题色", 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -186,7 +187,9 @@ function themeoptions_page(){
|
||||
|
||||
</style>
|
||||
|
||||
<?php $argon_show_customize_theme_color_picker = get_option('argon_show_customize_theme_color_picker');?>
|
||||
|
||||
|
||||
<?php $argon_show_customize_theme_color_picker = get_option('argon_show_customize_theme_color_picker');?>
|
||||
|
||||
<div style="margin-top: 15px;">
|
||||
|
||||
@@ -288,7 +291,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 2. 外观样式 ========== --><tr><th class="subtitle"><h2 id="section-appearance"><?php _e('外观样式', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 2. 外观样式 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-appearance"><?php _e('外观样式', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-card-style"><?php _e('卡片样式', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -376,7 +380,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 3. 页面布局 ========== --><tr><th class="subtitle"><h2 id="section-layout"><?php _e('页面布局', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 3. 页面布局 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-layout"><?php _e('页面布局', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-page-layout"><?php _e('整体布局', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -707,7 +712,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 4. 顶栏设置 ========== --><tr><th class="subtitle"><h2 id="section-toolbar"><?php _e('顶栏设置', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 4. 顶栏设置 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-toolbar"><?php _e('顶栏设置', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-toolbar-basic"><?php _e('基本设置', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -947,7 +953,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 5. Banner 设置 ========== --><tr><th class="subtitle"><h2 id="section-banner"><?php _e('Banner 设置', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 5. Banner 设置 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-banner"><?php _e('Banner 设置', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-banner-content"><?php _e('Banner 内容', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -1163,7 +1170,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 6. 页面背景 ========== --><tr><th class="subtitle"><h2 id="section-background"><?php _e('页面背景', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 6. 页面背景 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-background"><?php _e('页面背景', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-background-image"><?php _e('背景图片', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -1202,8 +1210,10 @@ function themeoptions_page(){
|
||||
<td colspan="2" style="padding: 20px 10px;">
|
||||
|
||||
<div style="display: flex; gap: 40px; align-items: flex-start;">
|
||||
<!-- 左侧:设置项 --><div style="flex: 1; max-width: 450px;">
|
||||
<!-- 背景不透明度 --><div style="margin-bottom: 20px;">
|
||||
<!-- 左侧:设置项 -->
|
||||
<div style="flex: 1; max-width: 450px;">
|
||||
<!-- 背景不透明度 -->
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; font-weight: 600; margin-bottom: 8px; color: #1d2327;"><?php _e('背景不透明度', 'argon');?></label>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<input type="range" name="argon_page_background_opacity" id="argon_page_bg_opacity_slider" min="0" max="1" step="0.01" value="<?php echo (get_option('argon_page_background_opacity') == '' ? '1' : get_option('argon_page_background_opacity')); ?>" style="flex: 1; cursor: pointer; height: 6px;">
|
||||
@@ -1212,7 +1222,8 @@ function themeoptions_page(){
|
||||
<p style="margin: 6px 0 0; font-size: 12px; color: #646970;"><?php _e('控制页面背景图片的不透明度', 'argon');?></p>
|
||||
</div>
|
||||
|
||||
<!-- 卡片透明度 --><div style="margin-bottom: 20px;">
|
||||
<!-- 卡片透明度 -->
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; font-weight: 600; margin-bottom: 8px; color: #1d2327;"><?php _e('卡片透明度', 'argon');?></label>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<input type="range" name="argon_post_background_opacity" id="argon_post_bg_opacity_slider" min="0" max="1" step="0.01" value="<?php echo (get_option('argon_post_background_opacity') == '' ? '0.7' : get_option('argon_post_background_opacity')); ?>" style="flex: 1; cursor: pointer; height: 6px;">
|
||||
@@ -1221,7 +1232,8 @@ function themeoptions_page(){
|
||||
<p style="margin: 6px 0 0; font-size: 12px; color: #646970;"><?php _e('控制文章、评论等卡片的背景透明度,推荐 0.7', 'argon');?></p>
|
||||
</div>
|
||||
|
||||
<!-- 毛玻璃模糊 --><div style="margin-bottom: 20px;">
|
||||
<!-- 毛玻璃模糊 -->
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; font-weight: 600; margin-bottom: 8px; color: #1d2327;"><?php _e('毛玻璃模糊', 'argon');?></label>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<input type="range" name="argon_card_blur" min="0" max="30" step="1" value="<?php echo (get_option('argon_card_blur', '20')); ?>" id="argon_card_blur_slider" style="flex: 1; cursor: pointer; height: 6px;">
|
||||
@@ -1230,7 +1242,8 @@ function themeoptions_page(){
|
||||
<p style="margin: 6px 0 0; font-size: 12px; color: #646970;"><?php _e('为卡片添加毛玻璃模糊效果,推荐 20px', 'argon');?></p>
|
||||
</div>
|
||||
|
||||
<!-- 毛玻璃饱和度 --><div style="margin-bottom: 10px;">
|
||||
<!-- 毛玻璃饱和度 -->
|
||||
<div style="margin-bottom: 10px;">
|
||||
<label style="display: block; font-weight: 600; margin-bottom: 8px; color: #1d2327;"><?php _e('毛玻璃饱和度', 'argon');?></label>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<input type="range" name="argon_card_saturate" min="100" max="250" step="10" value="<?php echo (get_option('argon_card_saturate', '180')); ?>" id="argon_card_saturate_slider" style="flex: 1; cursor: pointer; height: 6px;">
|
||||
@@ -1240,7 +1253,8 @@ function themeoptions_page(){
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:实时预览 --><div style="flex-shrink: 0;">
|
||||
<!-- 右侧:实时预览 -->
|
||||
<div style="flex-shrink: 0;">
|
||||
<label style="display: block; font-weight: 600; margin-bottom: 8px; color: #1d2327;"><?php _e('效果预览', 'argon');?></label>
|
||||
<?php $page_bg_url = get_option('argon_page_background_url'); ?>
|
||||
<div id="effect_preview_box" style="position: relative; width: 200px; height: 140px; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.12); background: #f4f5f7;">
|
||||
@@ -1330,7 +1344,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 7. 侧边栏 ========== --><tr><th class="subtitle"><h2 id="section-sidebar"><?php _e('侧边栏', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 7. 侧边栏 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-sidebar"><?php _e('侧边栏', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-author-info"><?php _e('作者信息', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -1480,7 +1495,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 8. 浮动按钮与页脚 ========== --><tr><th class="subtitle"><h2 id="section-fab-footer"><?php _e('浮动按钮与页脚', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 8. 浮动按钮与页脚 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-fab-footer"><?php _e('浮动按钮与页脚', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-fab"><?php _e('浮动操作按钮', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -1552,7 +1568,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 9. 高级设置 ========== --><tr><th class="subtitle"><h2 id="section-advanced"><?php _e('高级设置', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 9. 高级设置 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-advanced"><?php _e('高级设置', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-seo">SEO</h3></th></tr>
|
||||
|
||||
@@ -1584,7 +1601,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 10. 文章显示 ========== --><tr><th class="subtitle"><h2 id="section-post-display"><?php _e('文章显示', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 10. 文章显示 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-post-display"><?php _e('文章显示', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-post-meta"><?php _e('Meta 信息', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -1860,7 +1878,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 11. 文章功能 ========== --><tr><th class="subtitle"><h2 id="section-post-features"><?php _e('文章功能', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 11. 文章功能 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-post-features"><?php _e('文章功能', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-footnote"><?php _e('脚注引用', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -2198,7 +2217,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 12. 特殊页面 ========== --><tr><th class="subtitle"><h2 id="section-special-pages"><?php _e('特殊页面', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 12. 特殊页面 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-special-pages"><?php _e('特殊页面', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-archive"><?php _e('归档页面', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -2270,7 +2290,8 @@ function themeoptions_page(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 13. 功能增强 ========== --><tr><th class="subtitle"><h2 id="section-enhancements"><?php _e('功能增强', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 13. 功能增强 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-enhancements"><?php _e('功能增强', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-code-highlight"><?php _e('代码高亮', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -2975,7 +2996,8 @@ window.pjaxLoaded = function(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 14. 评论设置 ========== --><tr><th class="subtitle"><h2 id="section-comment"><?php _e('评论设置', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 14. 评论设置 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-comment"><?php _e('评论设置', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-comment-pagination"><?php _e('评论分页', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -3101,7 +3123,8 @@ window.pjaxLoaded = function(){
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 15. 验证码与安全 ========== --><tr><th class="subtitle"><h2 id="section-security"><?php _e('验证码与安全', 'argon');?></h2></th></tr>
|
||||
<!-- ========== 15. 验证码与安全 ========== -->
|
||||
<tr><th class="subtitle"><h2 id="section-security"><?php _e('验证码与安全', 'argon');?></h2></th></tr>
|
||||
|
||||
<tr><th class="subtitle"><h3 id="subsection-captcha"><?php _e('验证码设置', 'argon');?></h3></th></tr>
|
||||
|
||||
@@ -3209,7 +3232,9 @@ window.pjaxLoaded = function(){
|
||||
|
||||
var apiServer = $('input[name="argon_geetest_api_server"]').val().trim();
|
||||
|
||||
if (!captchaId || !captchaKey) {
|
||||
|
||||
|
||||
if (!captchaId || !captchaKey) {
|
||||
|
||||
alert('<?php _e('使用极验验证码时,验证码 ID 和 Key 为必填项', 'argon'); ?>');
|
||||
|
||||
@@ -3217,7 +3242,9 @@ if (!captchaId || !captchaKey) {
|
||||
|
||||
}
|
||||
|
||||
// 验证API服务器URL格式
|
||||
|
||||
|
||||
// 验证API服务器URL格式
|
||||
|
||||
if (apiServer && !apiServer.match(/^https?:\/\/.+/)) {
|
||||
|
||||
@@ -3233,7 +3260,9 @@ if (!captchaId || !captchaKey) {
|
||||
|
||||
}
|
||||
|
||||
$('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
|
||||
$('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
if ($(this).val() === 'geetest') {
|
||||
|
||||
@@ -3247,7 +3276,9 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
});
|
||||
|
||||
// 表单提交时验证
|
||||
|
||||
|
||||
// 表单提交时验证
|
||||
|
||||
$('form').submit(function(e) {
|
||||
|
||||
@@ -3427,7 +3458,8 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 返回评论系统 ========== --><tr><th class="subtitle"><h3 id="subsection-comment-features"><?php _e('评论功能', 'argon');?></h3></th></tr>
|
||||
<!-- ========== 返回评论系统 ========== -->
|
||||
<tr><th class="subtitle"><h3 id="subsection-comment-features"><?php _e('评论功能', 'argon');?></h3></th></tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -3905,13 +3937,13 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
foreach ($all_post_types as $post_type) {
|
||||
|
||||
if ($post_type->name == 'attachment'){
|
||||
if ($post_type -> name == 'attachment'){
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
echo '<div class="search-filter-item" filter-name="'. $post_type->name .'">'. $post_type->label .'</div>';
|
||||
echo '<div class="search-filter-item" filter-name="'. $post_type -> name .'">'. $post_type -> label .'</div>';
|
||||
|
||||
}
|
||||
|
||||
@@ -3995,7 +4027,8 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- ========== 邮件模板设置 ========== --><tr><th class="subtitle"><h3 id="subsection-email-template"><?php _e('邮件模板', 'argon');?></h3></th></tr>
|
||||
<!-- ========== 邮件模板设置 ========== -->
|
||||
<tr><th class="subtitle"><h3 id="subsection-email-template"><?php _e('邮件模板', 'argon');?></h3></th></tr>
|
||||
|
||||
<tr>
|
||||
<th><label><?php _e('邮件主题色', 'argon');?></label></th>
|
||||
@@ -4135,7 +4168,8 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<!-- 邮件预览弹窗 --><div id="argon_email_preview_modal" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100000;">
|
||||
<!-- 邮件预览弹窗 -->
|
||||
<div id="argon_email_preview_modal" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100000;">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 8px; width: 90%; max-width: 700px; max-height: 90vh; overflow: auto;">
|
||||
<div style="padding: 16px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;">
|
||||
<strong><?php _e('邮件预览', 'argon');?></strong>
|
||||
@@ -4313,7 +4347,7 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
foreach($categories as $category) {
|
||||
|
||||
echo "<span>".$category->name ."->". $category->term_id ."</span>";
|
||||
echo "<span>".$category -> name ." -> ". $category -> term_id ."</span>";
|
||||
|
||||
}
|
||||
|
||||
@@ -4331,7 +4365,7 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
foreach($categories as $category) {
|
||||
|
||||
echo "<span>".$category->name ."->". $category->term_id ."</span>";
|
||||
echo "<span>".$category -> name ." -> ". $category -> term_id ."</span>";
|
||||
|
||||
}
|
||||
|
||||
@@ -4619,7 +4653,9 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
<p class="description"><?php _e('启用后,当主题文件被更新时,将自动清理所有缓存并显示更新通知。', 'argon');?></p>
|
||||
|
||||
<?php $argon_hot_reload_auto_refresh = get_option('argon_hot_reload_auto_refresh', 'false'); ?>
|
||||
|
||||
|
||||
<?php $argon_hot_reload_auto_refresh = get_option('argon_hot_reload_auto_refresh', 'false'); ?>
|
||||
|
||||
<label style="display:block;margin-top:10px;">
|
||||
|
||||
@@ -4631,7 +4667,9 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
<p class="description" style="margin-left:24px;"><?php _e('推荐开启。用户访问时如检测到主题版本变化,将自动刷新页面以加载最新功能。', 'argon');?></p>
|
||||
|
||||
<?php $argon_hot_reload_frontend_notice = get_option('argon_hot_reload_frontend_notice', 'false'); ?>
|
||||
|
||||
|
||||
<?php $argon_hot_reload_frontend_notice = get_option('argon_hot_reload_frontend_notice', 'false'); ?>
|
||||
|
||||
<label style="display:block;margin-top:10px;">
|
||||
|
||||
@@ -4641,7 +4679,9 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
</label>
|
||||
|
||||
<div style="margin-top:15px;">
|
||||
|
||||
|
||||
<div style="margin-top:15px;">
|
||||
|
||||
<button type="button" class="button" id="argon_clear_cache_btn"><?php _e('手动清理缓存', 'argon');?></button>
|
||||
|
||||
@@ -4754,7 +4794,9 @@ $('select[name="argon_captcha_type"]').change(function() {
|
||||
|
||||
var countdownTimer = null;
|
||||
|
||||
function updateCountdown() {
|
||||
|
||||
|
||||
function updateCountdown() {
|
||||
|
||||
if (remainingSeconds <= 0) {
|
||||
|
||||
@@ -4778,7 +4820,9 @@ function updateCountdown() {
|
||||
|
||||
}
|
||||
|
||||
function updateUI() {
|
||||
|
||||
|
||||
function updateUI() {
|
||||
|
||||
var statusDiv = $('#argon_force_refresh_status');
|
||||
|
||||
@@ -4786,7 +4830,9 @@ function updateUI() {
|
||||
|
||||
var btn = $('#argon_force_refresh_btn');
|
||||
|
||||
if (isEnabled) {
|
||||
|
||||
|
||||
if (isEnabled) {
|
||||
|
||||
statusDiv.css({'background': '#d4edda', 'border': '1px solid #c3e6cb'});
|
||||
|
||||
@@ -4824,7 +4870,9 @@ if (isEnabled) {
|
||||
|
||||
}
|
||||
|
||||
// 初始化倒计时
|
||||
|
||||
|
||||
// 初始化倒计时
|
||||
|
||||
if (isEnabled && remainingSeconds > 0) {
|
||||
|
||||
@@ -4832,15 +4880,21 @@ if (isEnabled) {
|
||||
|
||||
}
|
||||
|
||||
$('#argon_force_refresh_btn').on('click', function() {
|
||||
|
||||
|
||||
$('#argon_force_refresh_btn').on('click', function() {
|
||||
|
||||
var btn = $(this);
|
||||
|
||||
btn.prop('disabled', true);
|
||||
|
||||
var action = isEnabled ? 'argon_disable_force_refresh' : 'argon_enable_force_refresh';
|
||||
|
||||
|
||||
$.post(ajaxurl, {
|
||||
var action = isEnabled ? 'argon_disable_force_refresh' : 'argon_enable_force_refresh';
|
||||
|
||||
|
||||
|
||||
$.post(ajaxurl, {
|
||||
|
||||
action: action,
|
||||
|
||||
@@ -4902,7 +4956,9 @@ $.post(ajaxurl, {
|
||||
|
||||
<p class="description"><?php _e('启用后,管理员可在前台看到调试按钮,点击打开控制台查看错误信息。普通用户遇到错误时会显示红色通知提示联系管理员。', 'argon');?></p>
|
||||
|
||||
<?php $muted_errors = get_option('argon_muted_errors', array()); ?>
|
||||
|
||||
|
||||
<?php $muted_errors = get_option('argon_muted_errors', array()); ?>
|
||||
|
||||
<?php if (!empty($muted_errors)): ?>
|
||||
|
||||
@@ -5334,7 +5390,9 @@ $.post(ajaxurl, {
|
||||
|
||||
}
|
||||
|
||||
.form-table > tbody > tr:first-child > th{
|
||||
|
||||
|
||||
.form-table > tbody > tr:first-child > th{
|
||||
|
||||
padding-top: 0 !important;
|
||||
|
||||
@@ -5348,7 +5406,9 @@ $.post(ajaxurl, {
|
||||
|
||||
}
|
||||
|
||||
.form-table-mathrender > tbody > tr > th > label > div {
|
||||
|
||||
|
||||
.form-table-mathrender > tbody > tr > th > label > div {
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
@@ -5372,7 +5432,9 @@ $.post(ajaxurl, {
|
||||
|
||||
}
|
||||
|
||||
#main_form > .form-table{
|
||||
|
||||
|
||||
#main_form > .form-table{
|
||||
|
||||
max-width: calc(100% - 180px);
|
||||
|
||||
@@ -5938,7 +6000,9 @@ function argon_update_themeoptions(){
|
||||
|
||||
argon_update_option('argon_show_comment_parent_info');
|
||||
|
||||
//LazyLoad 相关
|
||||
|
||||
|
||||
//LazyLoad 相关
|
||||
|
||||
argon_update_option('argon_enable_lazyload');
|
||||
|
||||
@@ -5948,7 +6012,9 @@ function argon_update_themeoptions(){
|
||||
|
||||
argon_update_option('argon_lazyload_loading_style');
|
||||
|
||||
//图片缩放预览相关
|
||||
|
||||
|
||||
//图片缩放预览相关
|
||||
|
||||
argon_update_option('argon_enable_fancybox');
|
||||
|
||||
@@ -5960,7 +6026,9 @@ function argon_update_themeoptions(){
|
||||
|
||||
argon_update_option('argon_zoomify_scale');
|
||||
|
||||
//数学公式相关配置项
|
||||
|
||||
|
||||
//数学公式相关配置项
|
||||
|
||||
argon_update_option('argon_math_render');
|
||||
|
||||
@@ -5970,13 +6038,17 @@ function argon_update_themeoptions(){
|
||||
|
||||
argon_update_option('argon_katex_cdn_url');
|
||||
|
||||
//页头页尾脚本
|
||||
|
||||
|
||||
//页头页尾脚本
|
||||
|
||||
argon_update_option_allow_tags('argon_custom_html_head');
|
||||
|
||||
argon_update_option_allow_tags('argon_custom_html_foot');
|
||||
|
||||
//公告
|
||||
|
||||
|
||||
//公告
|
||||
|
||||
argon_update_option_allow_tags('argon_sidebar_announcement');
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ query_posts("post_type=shuoshuo&post_status=publish&posts_per_page=-1");
|
||||
<?php } ?>
|
||||
<p class="text-black mt-3 mb-0 opacity-8">
|
||||
<i class="fa fa-quote-left mr-1"></i>
|
||||
<?php echo wp_count_posts('shuoshuo','')->publish; ?> <?php _e('条说说', 'argon');?>
|
||||
<?php echo wp_count_posts('shuoshuo','') -> publish; ?> <?php _e('条说说', 'argon');?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
71
sidebar.php
71
sidebar.php
@@ -15,8 +15,10 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
<aside id="leftbar" class="<?php echo $leftbar_class; ?>" role="complementary">
|
||||
|
||||
<!-- 移动端侧边栏 - 重新设计的布局 --><div id="leftbar_mobile_nav" class="leftbar-mobile-nav">
|
||||
<!-- 顶部用户信息区 --><div class="leftbar-mobile-profile">
|
||||
<!-- 移动端侧边栏 - 重新设计的布局 -->
|
||||
<div id="leftbar_mobile_nav" class="leftbar-mobile-nav">
|
||||
<!-- 顶部用户信息区 -->
|
||||
<div class="leftbar-mobile-profile">
|
||||
<div class="leftbar-mobile-close" id="leftbar_close_btn">
|
||||
<i class="fa fa-times"></i>
|
||||
</div>
|
||||
@@ -46,7 +48,8 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
<div class="leftbar-mobile-user-desc"><?php echo esc_html($author_desc); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<!-- 统计数据 --><div class="leftbar-mobile-stats">
|
||||
<!-- 统计数据 -->
|
||||
<div class="leftbar-mobile-stats">
|
||||
<div class="leftbar-mobile-stat">
|
||||
<span class="stat-num"><?php echo wp_count_posts()->publish; ?></span>
|
||||
<span class="stat-label"><?php _e('文章', 'argon'); ?></span>
|
||||
@@ -62,14 +65,16 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 搜索框 --><div class="leftbar-mobile-search">
|
||||
<!-- 搜索框 -->
|
||||
<div class="leftbar-mobile-search">
|
||||
<div class="leftbar-mobile-search-inner">
|
||||
<i class="fa fa-search"></i>
|
||||
<input type="text" id="leftbar_mobile_search_input" placeholder="<?php _e('搜索...', 'argon'); ?>" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 导航菜单 --><?php if ( has_nav_menu('toolbar_menu') ) : ?>
|
||||
<!-- 导航菜单 -->
|
||||
<?php if ( has_nav_menu('toolbar_menu') ) : ?>
|
||||
<div class="leftbar-mobile-menu-section">
|
||||
<div class="leftbar-mobile-section-title"><?php _e('导航', 'argon'); ?></div>
|
||||
<ul class="leftbar-mobile-menu">
|
||||
@@ -112,7 +117,8 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 侧边栏菜单 --><?php if ( has_nav_menu('leftbar_menu') ) : ?>
|
||||
<!-- 侧边栏菜单 -->
|
||||
<?php if ( has_nav_menu('leftbar_menu') ) : ?>
|
||||
<div class="leftbar-mobile-menu-section">
|
||||
<div class="leftbar-mobile-section-title"><?php _e('更多', 'argon'); ?></div>
|
||||
<ul class="leftbar-mobile-menu">
|
||||
@@ -129,7 +135,8 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 文章目录折叠面板 (仅在文章页显示) --><?php if (have_catalog()) : ?>
|
||||
<!-- 文章目录折叠面板 (仅在文章页显示) -->
|
||||
<?php if (have_catalog()) : ?>
|
||||
<div class="leftbar-mobile-collapse-section">
|
||||
<div class="leftbar-mobile-collapse-header" id="mobile_catalog_toggle">
|
||||
<div class="collapse-header-left">
|
||||
@@ -144,7 +151,8 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- TODO折叠面板 --><?php if (get_option('argon_show_todo_list', 'true') == 'true') : ?>
|
||||
<!-- TODO折叠面板 -->
|
||||
<?php if (get_option('argon_show_todo_list', 'true') == 'true') : ?>
|
||||
<?php
|
||||
$mobile_todos = argon_get_todo_list();
|
||||
$mobile_is_author = current_user_can('publish_posts');
|
||||
@@ -251,7 +259,8 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 顶栏自定义链接 --><?php
|
||||
<!-- 顶栏自定义链接 -->
|
||||
<?php
|
||||
$toolbar_links_left = get_option('argon_toolbar_links_left', '');
|
||||
$toolbar_links_right = get_option('argon_toolbar_links_right', '');
|
||||
$has_custom_links = !empty(trim($toolbar_links_left)) || !empty(trim($toolbar_links_right));
|
||||
@@ -298,7 +307,8 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 底部操作区 --><div class="leftbar-mobile-footer">
|
||||
<!-- 底部操作区 -->
|
||||
<div class="leftbar-mobile-footer">
|
||||
<div class="leftbar-mobile-actions">
|
||||
<button class="leftbar-mobile-action" onclick="toggleDarkmode()">
|
||||
<i class="fa fa-moon-o"></i>
|
||||
@@ -316,7 +326,8 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 桌面端原有侧边栏内容 --><div class="leftbar-desktop-content">
|
||||
<!-- 桌面端原有侧边栏内容 -->
|
||||
<div class="leftbar-desktop-content">
|
||||
<?php if (get_option('argon_sidebar_announcement') != '') { ?>
|
||||
|
||||
<div id="leftbar_announcement" class="card bg-white shadow-sm border-0">
|
||||
@@ -339,7 +350,9 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
<span class="leftbar-banner-title text-white"><?php echo get_option('argon_sidebar_banner_title') == '' ? bloginfo('name') : get_option('argon_sidebar_banner_title'); ?></span>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$sidebar_subtitle = get_option('argon_sidebar_banner_subtitle');
|
||||
|
||||
@@ -357,9 +370,13 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
<?php } /*顶栏标题*/?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/*侧栏上部菜单*/
|
||||
|
||||
@@ -385,9 +402,9 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
$output .= "\n
|
||||
|
||||
<li class='leftbar-menu-item" . ( $args->walker->has_children == 1 ? " leftbar-menu-item-haschildren" : "" ) . ( $object->current == 1 ? " current" : "" ) . "'>
|
||||
<li class='leftbar-menu-item" . ( $args -> walker -> has_children == 1 ? " leftbar-menu-item-haschildren" : "" ) . ( $object -> current == 1 ? " current" : "" ) . "'>
|
||||
|
||||
<a href='" . $object->url . "'" . ( $args->walker->has_children == 1 ? " no-pjax onclick='return false;'" : "" ) . " target='" . $object->target . "'>". $object->title . "</a>";
|
||||
<a href='" . $object -> url . "'" . ( $args -> walker -> has_children == 1 ? " no-pjax onclick='return false;'" : "" ) . " target='" . $object -> target . "'>". $object -> title . "</a>";
|
||||
|
||||
}
|
||||
|
||||
@@ -578,7 +595,7 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
<a <?php $archives_page_url = get_option('argon_archives_timeline_url'); echo (empty($archives_page_url) ? ' style="cursor: default;"' : 'href="' . $archives_page_url . '"');?>>
|
||||
|
||||
<span class="site-state-item-count"><?php echo wp_count_posts()->publish; ?></span>
|
||||
<span class="site-state-item-count"><?php echo wp_count_posts() -> publish; ?></span>
|
||||
|
||||
<span class="site-state-item-name"><?php _e('文章', 'argon');?></span>
|
||||
|
||||
@@ -626,7 +643,7 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
<div class='site-author-links-item'>
|
||||
|
||||
<a href='" . $object->url . "' rel='noopener' target='_blank'>". $object->title . "</a>";
|
||||
<a href='" . $object -> url . "' rel='noopener' target='_blank'>". $object -> title . "</a>";
|
||||
|
||||
}
|
||||
|
||||
@@ -644,7 +661,9 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
}
|
||||
|
||||
if ( has_nav_menu('leftbar_author_links') ){
|
||||
|
||||
|
||||
if ( has_nav_menu('leftbar_author_links') ){
|
||||
|
||||
echo "<div class='site-author-links'>";
|
||||
|
||||
@@ -682,7 +701,7 @@ if ( has_nav_menu('leftbar_author_links') ){
|
||||
|
||||
<li class='site-friend-links-item'>
|
||||
|
||||
<a href='" . $object->url . "' rel='noopener' target='_blank'>". $object->title . "</a>";
|
||||
<a href='" . $object -> url . "' rel='noopener' target='_blank'>". $object -> title . "</a>";
|
||||
|
||||
}
|
||||
|
||||
@@ -700,7 +719,9 @@ if ( has_nav_menu('leftbar_author_links') ){
|
||||
|
||||
}
|
||||
|
||||
if ( has_nav_menu('leftbar_friend_links') ){
|
||||
|
||||
|
||||
if ( has_nav_menu('leftbar_friend_links') ){
|
||||
|
||||
echo "<div class='site-friend-links'>
|
||||
|
||||
@@ -1157,7 +1178,9 @@ if ( has_nav_menu('leftbar_friend_links') ){
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
</div><!-- .leftbar-desktop-content --></aside>
|
||||
</div><!-- .leftbar-desktop-content -->
|
||||
|
||||
</aside>
|
||||
|
||||
<div class="modal fade" id="blog_categories" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
|
||||
|
||||
@@ -1201,7 +1224,7 @@ if ( has_nav_menu('leftbar_friend_links') ){
|
||||
|
||||
foreach($categories as $category) {
|
||||
|
||||
echo "<a href=" . get_category_link( $category->term_id ) . " class='badge badge-secondary tag'>" . $category->name . " <span class='tag-num'>" . $category->count . "</span></a>";
|
||||
echo "<a href=" . get_category_link( $category -> term_id ) . " class='badge badge-secondary tag'>" . $category->name . " <span class='tag-num'>" . $category -> count . "</span></a>";
|
||||
|
||||
}
|
||||
|
||||
@@ -1257,7 +1280,7 @@ if ( has_nav_menu('leftbar_friend_links') ){
|
||||
|
||||
foreach($categories as $category) {
|
||||
|
||||
echo "<a href=" . get_category_link( $category->term_id ) . " class='badge badge-secondary tag'>" . $category->name . " <span class='tag-num'>" . $category->count . "</span></a>";
|
||||
echo "<a href=" . get_category_link( $category -> term_id ) . " class='badge badge-secondary tag'>" . $category->name . " <span class='tag-num'>" . $category -> count . "</span></a>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
44
single.php
44
single.php
@@ -1,9 +1,15 @@
|
||||
<?php get_header(); ?>
|
||||
|
||||
|
||||
|
||||
<div class="page-information-card-container"></div>
|
||||
|
||||
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
|
||||
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
|
||||
<main id="main" class="site-main" role="main">
|
||||
@@ -14,16 +20,22 @@
|
||||
|
||||
the_post();
|
||||
|
||||
get_template_part( 'template-parts/content', 'single' );
|
||||
|
||||
// 文章操作按钮(分享和评论)
|
||||
|
||||
get_template_part( 'template-parts/content', 'single' );
|
||||
|
||||
|
||||
|
||||
// 文章操作按钮(分享和评论)
|
||||
get_template_part( 'template-parts/post-actions' );
|
||||
|
||||
if (comments_open() || get_comments_number()) {
|
||||
comments_template();
|
||||
}
|
||||
|
||||
if ( is_singular( 'post' ) ) {
|
||||
|
||||
|
||||
if ( is_singular( 'post' ) ) {
|
||||
|
||||
if (get_previous_post() || get_next_post()){
|
||||
|
||||
@@ -55,7 +67,9 @@ if ( is_singular( 'post' ) ) {
|
||||
|
||||
}
|
||||
|
||||
$relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
|
||||
$relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
if ($relatedPosts != "disabled"){
|
||||
|
||||
@@ -65,13 +79,13 @@ $relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
if (strpos($relatedPosts, 'category') !== false){
|
||||
|
||||
$cats = get_the_category($post->ID);
|
||||
$cats = get_the_category($post -> ID);
|
||||
|
||||
if ($cats){
|
||||
|
||||
foreach($cats as $key1 => $cat) {
|
||||
|
||||
$cat_array[$key1] = $cat->slug;
|
||||
$cat_array[$key1] = $cat -> slug;
|
||||
|
||||
}
|
||||
|
||||
@@ -83,13 +97,13 @@ $relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
if (strpos($relatedPosts, 'tag') !== false){
|
||||
|
||||
$tags = get_the_tags($post->ID);
|
||||
$tags = get_the_tags($post -> ID);
|
||||
|
||||
if ($tags){
|
||||
|
||||
foreach($tags as $key2 => $tag) {
|
||||
|
||||
$tag_array[$key2] = $tag->slug;
|
||||
$tag_array[$key2] = $tag -> slug;
|
||||
|
||||
}
|
||||
|
||||
@@ -107,7 +121,7 @@ $relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
'meta_key' => 'views',
|
||||
|
||||
'post__not_in' => array($post->ID),
|
||||
'post__not_in' => array($post -> ID),
|
||||
|
||||
'tax_query' => array(
|
||||
|
||||
@@ -139,7 +153,7 @@ $relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
));
|
||||
|
||||
if ($query->have_posts()) {
|
||||
if ($query -> have_posts()) {
|
||||
|
||||
echo '<div class="related-posts card shadow-sm">
|
||||
|
||||
@@ -153,9 +167,9 @@ $relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
<div style="overflow-x: auto;padding: 1.5rem;padding-top: 0.8rem;padding-bottom: 0.8rem;}">';
|
||||
|
||||
while ($query->have_posts()) {
|
||||
while ($query -> have_posts()) {
|
||||
|
||||
$query->the_post();
|
||||
$query -> the_post();
|
||||
|
||||
$hasThumbnail = argon_has_post_thumbnail(get_the_ID());
|
||||
|
||||
@@ -187,9 +201,13 @@ $relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
}
|
||||
|
||||
endwhile;
|
||||
|
||||
|
||||
endwhile;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user