Hey guys, I’m using the ACF Plugin to create custom post types.
This works as intended, but the generated custom fieldsets (not post type, the fieldsets from the plugin) are showed inisde the avia blog elements, when I select the default category.
Is there a way to modify the query to not show things other than blog posts?
Hey Luca,
Thank you for using Enfold.
We can’t really see the problem in that page. Could you give us a screenshot of the issue? You can use imgur or dropbox for the screenshot.
Best regards,
Ismael
Hi,
Thank you for the screenshot.
The following filter might help. Just add it in the functions.php file.
add_filter('avia_blog_post_query', 'avia_blog_post_query_mod', 10, 2);
function avia_blog_post_query_mod($query, $params) {
foreach($query['post_type'] as $key => $value) {
if( $value == 'acf-field-group' ) {
unset($query['post_type'][$key]);
}
}
return $query;
}
Let us know if it works.
Best regards,
Ismael
I ran in to the same problem today, though the ACF field group was appearing on my blog category page, not inside an Enfold blog element. I quickly realized that it was a field group I’d recently imported using the ACF tools. A look in the database showed that the acf-field-group post had been placed in my default blog category during import. Looks like a bug with the ACF import, but thought this might be helpful for others to know.