Tagged: blog posts element
-
AuthorPosts
-
August 14, 2019 at 2:26 pm #1127621
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
August 19, 2019 at 12:13 pm #1128876Hi guys, can you give an update on this one? Thanks!
August 19, 2019 at 2:56 pm #1128920Hi,
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,
IsmaelAugust 19, 2019 at 4:56 pm #1128956Hi Ismael,
I added the code to the child theme’s functions.php, but it is nog making a difference. Any more suggestions?
Thanks,
IvanAugust 20, 2019 at 1:38 am #1129057Hi,
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,
IsmaelAugust 20, 2019 at 9:03 am #1129159This reply has been marked as private.August 21, 2019 at 6:12 am #1129442Hi,
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,
IsmaelAugust 26, 2019 at 1:19 pm #1130966Perfect, thanks!
August 26, 2019 at 6:26 pm #1131071Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘ACF field group post type in Blog posts elements’ is closed to new replies.
