Posts Block: Category Exclude Support
-
Hi Munir!
Thanks for the cool plugin.
I’m wondering if you’d be willing to add “Category Exclude” support to the Posts block in the next release?
I created a “acfb_category_exclude” Taxonomy field to the field group and then added the following to acfblocks-templates/free/acfb-posts.php:
// BEGIN Exclude support $acfb_exclude = get_field( 'acfb_category_exclude' ); $acfb_exclude_names = array(); if(is_array($acfb_exclude)){ foreach($acfb_exclude as $catskey => $catsval){ $acfb_exclude_names[] = $catsval; } } // END Exclude support $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $acfb_number_of_posts, 'cat' => $acfb_cat_names, 'category__not_in' => $acfb_exclude_names, // ADDED for Exclude Support );
Thanks for your consideration!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Posts Block: Category Exclude Support’ is closed to new replies.