diff --git a/inc/theme-article.php b/inc/theme-article.php
index d8fa2f9..577447c 100644
--- a/inc/theme-article.php
+++ b/inc/theme-article.php
@@ -1,9 +1,10 @@
* @license MIT License
- * @version 2021.07.01
+ * @version 2021.08.19
*/
// 文章链接添加 target 和 rel
@@ -102,13 +103,15 @@ add_filter('excerpt_length', 'excerpt_length');
add_theme_support("post-thumbnails");
// 生成适合特色图的比例图片
-add_image_size( 'kratos-thumbnail', 512, 288, true );
+add_image_size('kratos-thumbnail', 512, 288, true);
// 强制图片链接到媒体文件
add_action('after_setup_theme', 'default_attachment_display_settings');
-function default_attachment_display_settings() {
- update_option('image_default_link_type', 'file');
+function default_attachment_display_settings()
+{
+ update_option('image_default_link_type', 'file');
}
+
// 文章特色图片
function post_thumbnail()
{
@@ -131,13 +134,7 @@ function post_thumbnail()
if (!empty($img_val)) {
echo '';
} else {
- $category=get_the_category($post->ID);
- $catid=$category[0]->term_id;
- if(kratos_option('essay_feature_img_'.$catid)
- && kratos_option('essay_feature_img_usable',true))
- {
- $img = kratos_option('essay_feature_img_'.$catid);
- }elseif(!kratos_option('g_postthumbnail')) {
+ if (!kratos_option('g_postthumbnail')) {
$img = ASSET_PATH . '/assets/img/default.jpg';
} else {
$img = kratos_option('g_postthumbnail', ASSET_PATH . '/assets/img/default.jpg');
@@ -151,8 +148,13 @@ function post_thumbnail()
function pagelist($range = 5)
{
global $paged, $wp_query, $max_page;
- if (!$max_page) {$max_page = $wp_query->max_num_pages;}
- if ($max_page > 1) {if (!$paged) {$paged = 1;}
+ if (!$max_page) {
+ $max_page = $wp_query->max_num_pages;
+ }
+ if ($max_page > 1) {
+ if (!$paged) {
+ $paged = 1;
+ }
echo "