refactor: change option id

pull/409/head^2
Seaton Jiang 2021-08-19 16:14:21 +08:00
parent bf15cd960d
commit 340a746826
No known key found for this signature in database
GPG Key ID: 0E05070D261ACFEA
1 changed files with 53 additions and 36 deletions

View File

@ -1,9 +1,10 @@
<?php <?php
/** /**
* 文章内容 * 文章内容
* @author Seaton Jiang <seatonjiang@vtrois.com> * @author Seaton Jiang <seatonjiang@vtrois.com>
* @license MIT License * @license MIT License
* @version 2021.07.01 * @version 2021.08.19
*/ */
get_header(); get_header();
@ -17,7 +18,8 @@ $select_col = $col_array[kratos_option('g_article_widgets', 'two_side')];
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="<?php echo $select_col ?> details"> <div class="<?php echo $select_col ?> details">
<?php if (have_posts()) : the_post(); update_post_caches($posts); ?> <?php if (have_posts()) : the_post();
update_post_caches($posts); ?>
<div class="article"> <div class="article">
<div class="breadcrumb-box"> <div class="breadcrumb-box">
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -49,20 +51,31 @@ $select_col = $col_array[kratos_option('g_article_widgets', 'two_side')];
<h1 class="title"><?php the_title(); ?></h1> <h1 class="title"><?php the_title(); ?></h1>
<div class="meta"> <div class="meta">
<span><?php echo get_the_date(); ?></span> <span><?php echo get_the_date(); ?></span>
<span ><?php echo get_post_views(); _e('点热度' , 'kratos'); ?></span> <span><?php echo get_post_views();
<span><?php if (get_post_meta($post->ID, 'love', true)) { echo get_post_meta($post->ID, 'love', true); } else {echo '0'; } _e('人点赞', 'kratos'); ?></span> _e('点热度', 'kratos'); ?></span>
<span><?php comments_number('0', '1', '%'); _e('条评论', 'kratos'); ?></span> <span><?php if (get_post_meta($post->ID, 'love', true)) {
<?php if (current_user_can('edit_posts')){ echo '<span>'; edit_post_link(__('编辑文章', 'kratos')); echo '</span>'; }; ?> echo get_post_meta($post->ID, 'love', true);
} else {
echo '0';
}
_e('人点赞', 'kratos'); ?></span>
<span><?php comments_number('0', '1', '%');
_e('条评论', 'kratos'); ?></span>
<?php if (current_user_can('edit_posts')) {
echo '<span>';
edit_post_link(__('编辑文章', 'kratos'));
echo '</span>';
}; ?>
</div> </div>
</div> </div>
<div class="content" id="lightgallery"> <div class="content" id="lightgallery">
<?php <?php
if (kratos_option('s_singletop', false)) { if (kratos_option('s_singletop', false)) {
if(kratos_option('s_singletop_links')){ if (kratos_option('s_singletop_url')) {
echo '<a href="'. kratos_option('s_singletop_links') .'" target="_blank" rel="noreferrer">'; echo '<a href="' . kratos_option('s_singletop_url') . '" target="_blank" rel="noreferrer">';
} }
echo '<img src="'.kratos_option('s_singletop_url').'">'; echo '<img src="' . kratos_option('s_singletop_img') . '">';
if(kratos_option('s_singletop_links')){ if (kratos_option('s_singletop_url')) {
echo '</a>'; echo '</a>';
} }
} }
@ -95,11 +108,11 @@ $select_col = $col_array[kratos_option('g_article_widgets', 'two_side')];
) )
); );
if (kratos_option('s_singledown', false)) { if (kratos_option('s_singledown', false)) {
if(kratos_option('s_singledown_links')){ if (kratos_option('s_singledown_url')) {
echo '<a href="'. kratos_option('s_singledown_links') .'" target="_blank" rel="noreferrer">'; echo '<a href="' . kratos_option('s_singledown_url') . '" target="_blank" rel="noreferrer">';
} }
echo '<img src="'.kratos_option('s_singledown_url').'">'; echo '<img src="' . kratos_option('s_singledown_img') . '">';
if(kratos_option('s_singledown_links')){ if (kratos_option('s_singledown_url')) {
echo '</a>'; echo '</a>';
} }
} }
@ -122,7 +135,11 @@ $select_col = $col_array[kratos_option('g_article_widgets', 'two_side')];
<div class="footer clearfix"> <div class="footer clearfix">
<div class="tags float-left"> <div class="tags float-left">
<span><?php _e('标签:', 'kratos'); ?></span> <span><?php _e('标签:', 'kratos'); ?></span>
<?php if ( get_the_tags() ) { the_tags('', ' ', ''); } else{ echo '<a>' . __( '暂无' , 'kratos') . '</a>'; }?> <?php if (get_the_tags()) {
the_tags('', ' ', '');
} else {
echo '<a>' . __('暂无', 'kratos') . '</a>';
} ?>
</div> </div>
<div class="tool float-right d-none d-lg-block"> <div class="tool float-right d-none d-lg-block">
<span><?php _e('最后更新:', 'kratos'); ?><?php the_modified_date(); ?></span> <span><?php _e('最后更新:', 'kratos'); ?><?php the_modified_date(); ?></span>