Support

Account

Home Forums Front-end Issues posts_clauses drop ACF get_field function Reply To: posts_clauses drop ACF get_field function

  • Your filter on the hook posts_clauses affects every query that is done, in this case it will happen on any page load where this is true

    
    if ( is_woocommerce() && ( is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy() ) ) {
    

    and this will effect ACF queries to get values of fields.

    I cannot tell you how to correct this, when I’m altering a WP query I generally do this by using a pre_get_posts action and for example if I want to change the orderby value I do it by altering the main query, not by adding clauses to the query.