Support

Account

Home Forums Front-end Issues Most efficient way to access ACF properties when listing posts? Reply To: Most efficient way to access ACF properties when listing posts?

  • The first time that you call the_field(), all of the custom field data for the post should be retrieved from the database and stored in the WP cache. Subsequent calls the the_field() get values from this cache. At least that’s the way it’s supposed to work.

    You can test this by installing this plugin https://wordpress.org/plugins/query-monitor/

    load your page and see how many queries are done. Then add this directly before your calls the_field();

    
    $meta = get_post_meta();
    

    This specifically tells WP to get all custom fields for a post. When you load your page again there should be no difference in the number of queries.