Blog Posts Categories and Taxonomy are checkboxes and only show first one.
-
Hi I use the acf form fields for the blog posts and trying to show the list of posts with their categories and taxonomies but it will only show one. Even if that one is not selected it shows the first id.
$categories = get_field('select_category'); $args = array( 'posts_per_page' => -1, 'post_type' => 'post', 'post_status' => 'publish', 'category' => $categories, ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $categories = get_the_category(); $category_list = join( ', ', wp_list_pluck( $categories, 'name' ) ); echo wp_kses_post( $category_list );
How can I get it to play nicely?
Thanks
- The topic ‘Blog Posts Categories and Taxonomy are checkboxes and only show first one.’ is closed to new replies.