Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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

    #1128876

    Hi guys, can you give an update on this one? Thanks!

    #1128920

    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

    #1128956

    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

    #1129057

    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

    #1129159
    This reply has been marked as private.
    #1129442

    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

    #1130966

    Perfect, thanks!

    #1131071

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘ACF field group post type in Blog posts elements’ is closed to new replies.