<?php
/**
 * 新闻列表页
 */
?>
<?php get_header();?>

<div class="page-full-width">
	<div class="row">
		<div class="col-md-12">
			<?php 
			// 获取分类图片作为banner背景
			$banner_bg_image = 'https://nenghui.com/wp-content/uploads/2025/07/News-top-bg.webp'; // 默认背景图片
			if (is_category()) {
				$category = get_queried_object();
				$category_image_url = get_category_image_url($category->term_id, 'full');
				if ($category_image_url) {
					$banner_bg_image = $category_image_url;
				}
			}
			echo do_shortcode('[nenghui_banner_title bg_image="' . esc_url($banner_bg_image) . '" title="NEWS" description="Nenghui has been awarded excellent honors in the industry and is committed to providing prompt service for all of our current and potential customers." overlay_opacity="0.5"]'); 
			?> 
			<?php echo do_shortcode('[nenghui_about_nav menu_id="4"]'); ?> 
			<?php echo do_shortcode('[nenghui_news_grid title="NEWS" posts_per_page="12" enable_pagination="true" order_by="date" order="DESC"]'); ?> 
		</div>
	</div>
</div>

<?php get_footer();?>