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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.