From 92b8f73ec68048ce7303d4449a214ca1d6d74557 Mon Sep 17 00:00:00 2001 From: huyuanxiang <273637057@qq.com> Date: Wed, 8 Apr 2026 11:31:50 +0800 Subject: [PATCH] =?UTF-8?q?0408=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nenghui-energy-theme-cn/archive.php | 184 +++++++++++------- .../assets/css/animations.css | 4 +- .../assets/css/footer.css | 5 +- .../assets/css/single-sidebar.css | 5 +- .../assets/images/home-p-2.png | Bin 374345 -> 362026 bytes .../themes/nenghui-energy-theme-cn/footer.php | 31 +-- .../themes/nenghui-energy-theme-cn/header.php | 14 +- .../inc/assets-loader.php | 12 +- .../nenghui-energy-theme-cn/page-about.php | 34 ++-- .../page-privacy-policy.php | 2 +- .../themes/nenghui-energy-theme-cn/search.php | 2 +- .../themes/nenghui-energy-theme-cn/single.php | 87 ++++++--- .../themes/nenghui-energy-theme-cn/style.css | 9 +- .../template-parts/block/block-cooperate.php | 9 +- 14 files changed, 257 insertions(+), 141 deletions(-) diff --git a/wp-content/themes/nenghui-energy-theme-cn/archive.php b/wp-content/themes/nenghui-energy-theme-cn/archive.php index cba78ad..a3d9777 100644 --- a/wp-content/themes/nenghui-energy-theme-cn/archive.php +++ b/wp-content/themes/nenghui-energy-theme-cn/archive.php @@ -6,13 +6,39 @@ -
-
-
-

新闻中心

-
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ newspaper + 最新资讯
-
+ + +

+ 新闻中心 +

+ + +

+ 关注企业最新动态、行业前沿资讯及重大活动报道,与您分享我们的成长与洞察。 +

+ + +
-
-
+ + +
+ -
+
slug; } ?> - - + +
+ +
-
- + -
+
-
+
-
- + + +
+ +
+ + + - -
-
+ +
+
'post', 'posts_per_page' => 5, @@ -91,16 +130,13 @@ 'paged' => $paged ); - // 如果是分类归档页面,添加分类筛选 if (is_category()) { $args['cat'] = get_query_var('cat'); } - // 处理分类筛选(URL参数优先) + // 处理分类筛选 if (isset($_GET['category']) && !empty($_GET['category'])) { $args['category_name'] = sanitize_text_field($_GET['category']); - // 修复:如果有明确的分类筛选参数,且该参数与当前归档分类不同,则移除归档分类限制 - // 这样可以避免 "在分类A下搜索分类B" 导致的结果为空(除非文章同时属于两个分类) if (isset($args['cat'])) { unset($args['cat']); } @@ -115,71 +151,82 @@ if ($articles_query->have_posts()) : while ($articles_query->have_posts()) : $articles_query->the_post(); - // 获取文章特色图片 - $featured_image = get_the_post_thumbnail_url(get_the_ID(), 'medium'); + $featured_image = get_the_post_thumbnail_url(get_the_ID(), 'medium_large'); if (!$featured_image) { $featured_image = get_template_directory_uri() . '/assets/images/default-post.jpg'; } - - // 获取文章摘要 $excerpt = get_the_excerpt(); if (empty($excerpt)) { $excerpt = wp_trim_words(get_the_content(), 20, '...'); } - - // 获取发布时间 $post_date = get_the_date('Y-m-d'); ?> -
-
- - <?php echo esc_attr(get_the_title()); ?> + + +
+ + +
+ + <?php echo esc_attr(get_the_title()); ?>
-
-
+