• Hi, I need some help.

    I have a news portal where my homepage uses the field relationship, but my app has this field ten times on this page.

    With that, it gives 126k records, it is very slow.

    I did what this link told me, but it didn’t work:

    https://www.advancedcustomfields.com/resources/acf-fields-relationship-query/

    This process is very slow and sometimes I get this message:

    Fatal Error: Out of Memory (allocated 89346048) (trying to allocate 20480 bytes)

    Today my code is thus:

    function my_relationship_query( $args, $field, $post_id ) {

    // only show children of the current post being edited
    $args[‘posts_per_page’] = ‘5’;
    $args[‘order’] = ‘DESC’;

    // return
    return $args;

    }

    // filter for every field
    add_filter(‘acf/fields/relationship/query’, ‘my_relationship_query’, 10, 3);

  • The topic ‘Field Relationship post’ is closed to new replies.