我将根据类别过滤我的循环。问题是,当我使用以下代码时,它会显示我的所有帖子。
// Query args
$custom_cat_args = array(
\'posts_per_page\' => 15,
\'order\' => \'DESC\',
\'orderby\' => \'post_date\',
\'category\' => get_cat_ID( \'سیاست\' )
);
// Instantiate query
$custom_cat_query = new WP_Query( $custom_cat_args );
// Instantiate loop
if ( $custom_cat_query->have_posts() ) : while ( $custom_cat_query->have_posts() ) : $custom_cat_query->the_post();
// Normal loop markup here
// Close loop
endwhile; endif;
// Restore $post global
wp_reset_postdata();