Hi,
We are having the same issue as https://kriesi.at/support/topic/acf-field-group-post-type-in-blog-posts-elements/. ACF groups are being shown on the blog page and the ‘no category’ archive page.
For the blog layout we are using ‘Use the advance layout editor to build your own blog layout (simply edit the page you have chosen in Enfold->Theme Options as a blog page)’. On the blog page we are using the Masonry element to show the blog posts.
Using the snippet as specified in this post https://kriesi.at/support/topic/acf-field-group-post-type-in-blog-posts-elements/ did not solve our issue. We tried the avia_blog_post_query and the avia_post_slide_query filter.
Hey CS,
Thank you for the inquiry.
Where can we see the issue? Which builder element or blog layout are you using? If the layout is set to grid, the avia_post_slide_query filter should have worked. Please provide the page URL so that we can inspect the issue further.
Best regards,
Ismael
Hi Ismael,
I’ve added the links to the affected pages in the private content.
We’re currently using the ‘Masonry’ builder element to display the posts.
Hi,
Thank you for the info.
Try to replace the snippet or filter with the following code.
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;
}
add_filter('avia_masonry_entries_query', 'avia_blog_post_query_mod', 10, 2);
add_filter('avia_blog_post_query', 'avia_blog_post_query_mod', 10, 2);
Best regards,
Ismael