From e6c1aa44db8dd3572b1bfad5f6d244b2668fc112 Mon Sep 17 00:00:00 2001 From: 3err0 Date: Tue, 17 Mar 2020 15:12:03 +0800 Subject: [PATCH] show in archive only standard post format --- archive.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/archive.php b/archive.php index 16378ff..f9e5e5d 100644 --- a/archive.php +++ b/archive.php @@ -11,8 +11,30 @@ get_header(); ?> if ( have_posts() ) { echo "

", the_title(), "

"; } -// the query -$wpb_all_query = new WP_Query(array('post_type'=>'post', 'post_status'=>'publish', 'posts_per_page'=>-1)); ?> + +$params = array( + array('post_type'=>'post', 'post_status'=>'publish', 'posts_per_page'=>-1), + 'tax_query' => array( + array( + 'taxonomy' => 'post_format', + 'field' => 'slug', + 'terms' => array( + 'post-format-aside', + 'post-format-audio', + 'post-format-chat', + 'post-format-gallery', + 'post-format-image', + 'post-format-link', + 'post-format-quote', + 'post-format-status', + 'post-format-video' + ), + 'operator' => 'NOT IN' + ) + ) +); + +$wpb_all_query = new WP_Query($params); ?> have_posts() ) : ?>