refactor: 规范化 PHP 模板文件
- header.php: 修复箭头操作符空格, 移除多余空行 (1520 -> 1481 行) - footer.php: 修复箭头操作符空格, 移除多余空行 (177 -> 168 行) - sidebar.php: 修复箭头操作符空格, 移除多余空行 (1311 -> 1288 行) - single.php: 修复箭头操作符空格, 移除多余空行 (214 -> 196 行) - comments.php: 修复箭头操作符空格 - search.php: 修复箭头操作符空格
This commit is contained in:
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,16 +383,14 @@ 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,8 +29,7 @@
|
||||
|
||||
</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*/?>
|
||||
@@ -149,17 +148,13 @@
|
||||
|
||||
<?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>
|
||||
|
||||
@@ -167,10 +162,6 @@
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
<?php echo get_option('argon_custom_html_foot'); ?>
|
||||
|
||||
|
||||
|
||||
</html>
|
||||
|
||||
79
header.php
79
header.php
@@ -196,9 +196,7 @@
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$seo_keywords = get_seo_keywords();
|
||||
|
||||
@@ -208,9 +206,7 @@
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
if (is_single() || is_page()){
|
||||
|
||||
@@ -232,9 +228,7 @@
|
||||
|
||||
<?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); ?>">
|
||||
|
||||
@@ -242,21 +236,13 @@
|
||||
|
||||
<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']; ?>">
|
||||
|
||||
|
||||
<meta name="theme-version" content="<?php echo $GLOBALS['theme_version']; ?>">
|
||||
|
||||
|
||||
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
|
||||
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
|
||||
|
||||
@@ -293,8 +279,7 @@
|
||||
<?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); ?>';
|
||||
@@ -337,8 +322,7 @@
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- 移动端资源加载修复 - 确保 CSS 完全应用 -->
|
||||
<script>
|
||||
<!-- 移动端资源加载修复 - 确保 CSS 完全应用 --><script>
|
||||
(function() {
|
||||
// 检测移动端并强制重新计算样式
|
||||
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
||||
@@ -370,8 +354,7 @@
|
||||
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'); ?>
|
||||
|
||||
@@ -565,9 +548,7 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function toggleAmoledDarkMode(){
|
||||
function toggleAmoledDarkMode(){
|
||||
|
||||
document.documentElement.classList.toggle("amoled-dark");
|
||||
|
||||
@@ -605,9 +586,7 @@
|
||||
|
||||
</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>
|
||||
|
||||
@@ -627,12 +606,8 @@
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<?php echo get_option('argon_custom_html_head'); ?>
|
||||
|
||||
|
||||
|
||||
<style id="themecolor_css">
|
||||
|
||||
<?php
|
||||
@@ -770,8 +745,6 @@ if ($animation_style == 'apple') {
|
||||
<?php endif; ?>
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<body <?php body_class(); ?>>
|
||||
|
||||
<?php /*wp_body_open();*/ ?>
|
||||
@@ -882,17 +855,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>";
|
||||
|
||||
@@ -902,11 +875,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>";
|
||||
|
||||
@@ -914,7 +887,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>";
|
||||
|
||||
}
|
||||
|
||||
@@ -1064,9 +1037,7 @@ 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'); ?>">
|
||||
|
||||
@@ -1090,9 +1061,7 @@ if ($animation_style == 'apple') {
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$banner_title = get_option('argon_banner_title') == '' ? get_bloginfo('name') : get_option('argon_banner_title');
|
||||
|
||||
@@ -1144,8 +1113,6 @@ if ($animation_style == 'apple') {
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<?php if (apply_filters('argon_page_background_url', get_option('argon_page_background_url')) != '') { ?>
|
||||
|
||||
<style>
|
||||
@@ -1286,8 +1253,7 @@ 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');
|
||||
@@ -1328,7 +1294,6 @@ 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>
|
||||
@@ -1365,8 +1330,6 @@ 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'); ?>">
|
||||
@@ -1513,7 +1476,5 @@ 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>
|
||||
|
||||
71
sidebar.php
71
sidebar.php
@@ -15,10 +15,8 @@ $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>
|
||||
@@ -48,8 +46,7 @@ $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>
|
||||
@@ -65,16 +62,14 @@ $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">
|
||||
@@ -117,8 +112,7 @@ $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">
|
||||
@@ -135,8 +129,7 @@ $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">
|
||||
@@ -151,8 +144,7 @@ $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');
|
||||
@@ -259,8 +251,7 @@ $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));
|
||||
@@ -307,8 +298,7 @@ $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>
|
||||
@@ -326,8 +316,7 @@ $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">
|
||||
@@ -350,9 +339,7 @@ $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');
|
||||
|
||||
@@ -370,13 +357,9 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
<?php } /*顶栏标题*/?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
/*侧栏上部菜单*/
|
||||
|
||||
@@ -402,9 +385,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>";
|
||||
|
||||
}
|
||||
|
||||
@@ -595,7 +578,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>
|
||||
|
||||
@@ -643,7 +626,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>";
|
||||
|
||||
}
|
||||
|
||||
@@ -661,9 +644,7 @@ $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'>";
|
||||
|
||||
@@ -701,7 +682,7 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
<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>";
|
||||
|
||||
}
|
||||
|
||||
@@ -719,9 +700,7 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( has_nav_menu('leftbar_friend_links') ){
|
||||
if ( has_nav_menu('leftbar_friend_links') ){
|
||||
|
||||
echo "<div class='site-friend-links'>
|
||||
|
||||
@@ -1178,9 +1157,7 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
</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">
|
||||
|
||||
@@ -1224,7 +1201,7 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
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>";
|
||||
|
||||
}
|
||||
|
||||
@@ -1280,7 +1257,7 @@ $author_desc = get_option('argon_sidebar_author_description');
|
||||
|
||||
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,15 +1,9 @@
|
||||
<?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">
|
||||
@@ -20,22 +14,16 @@
|
||||
|
||||
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()){
|
||||
|
||||
@@ -67,9 +55,7 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
$relatedPosts = get_option('argon_related_post', 'disabled');
|
||||
|
||||
if ($relatedPosts != "disabled"){
|
||||
|
||||
@@ -79,13 +65,13 @@
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
@@ -97,13 +83,13 @@
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
@@ -121,7 +107,7 @@
|
||||
|
||||
'meta_key' => 'views',
|
||||
|
||||
'post__not_in' => array($post -> ID),
|
||||
'post__not_in' => array($post->ID),
|
||||
|
||||
'tax_query' => array(
|
||||
|
||||
@@ -153,7 +139,7 @@
|
||||
|
||||
));
|
||||
|
||||
if ($query -> have_posts()) {
|
||||
if ($query->have_posts()) {
|
||||
|
||||
echo '<div class="related-posts card shadow-sm">
|
||||
|
||||
@@ -167,9 +153,9 @@
|
||||
|
||||
<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());
|
||||
|
||||
@@ -201,13 +187,9 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
endwhile;
|
||||
endwhile;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user