Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1320866

    Hi,

    I’ve suddenly got ACF field groups showing up in Masonry element.

    I’ve looked at this post – https://kriesi.at/support/topic/acf-field-group-post-type-in-blog-posts-elements/ – and tried the function suggested in there but that doesn’t cure the issue.

    Screen Grab

    How can I stop this from happening?

    #1321018

    Hey philthebass,

    Thank you for the inquiry.

    You may need to use the avia_masonry_entries_query filter instead of the previous one. Please try this code.

    
    function avia_masonry_entries_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_masonry_entries_query_mod', 10, 2);
    

    Best regards,
    Ismael

    #1321019

    Hi Ismael,

    I tried that but it breaks the site if I add it to the child functions.php

    “There has been a critical error on this website.”

    #1321334

    Hi,

    Thank you for the update.

    Did you remove the previous filter? Please make sure that there are no duplicate function in the functions.php file. And try to copy the snippet directly from the forum, instead of your email.

    Best regards,
    Ismael

    #1321644

    Thanks Ismael,

    I copied it from the forum and that works nicely.

    Thanks for your help.

    Regards

    Phil

    #1322097

    Hi,

    Great! Glad to know that it is working correctly now. Please let us know in a different thread if you need anything else. We will close this one for now.

    Have a nice day.

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘ACF Groups Showing In Masonry Element’ is closed to new replies.