Tagged: blog posts element
Hi there,
A blog posts element that is set to show posts of a certain category, also posts ACF’s custom post type “acf-field-group” are included. They shouldn’t be showing up there, as they are ntw publishable post-type at all. Do you know why they can end up there, and how to prevent them from doing so? Thanks!
Ivan
Hi guys, can you give an update on this one? Thanks!
Hi,
Thank you for the update.
We’ve recently encountered an issue like this and provided a snippet to exclude the “acf-field-group” post type from the query. We’re not really sure if it worked because the user didn’t respond. You can try this code 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;
}
Best regards,
Ismael
Hi Ismael,
I added the code to the child theme’s functions.php, but it is nog making a difference. Any more suggestions?
Thanks,
Ivan
Hi,
Thank you for the update.
Are you using the grid layout? Please provide the login details in the private field so that we can check the setup.
Best regards,
Ismael
Hi,
Thank you for the update.
We adjusted the code a bit — replaced “avia_blog_post_query” with “avia_post_slide_query” because the layout is set to grid. It is working properly now.
Best regards,
Ismael
Perfect, thanks!
Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon