Home › Forums › Front-end Issues › I recive value for only 1,3,5,etc. post › Reply To: I recive value for only 1,3,5,etc. post
More than likely this has to do with your use of wp_reset_postdata()
and wp_reset_query()
.
Both of these function reset the query to information about the “Main Query” not to the “Previous Query”.
So every time you call wp_reset_query()
in the left or right template part you are resetting to the “Main Query” which is probably causing issues in loop in the first part of your code.
Also this line in your template part
query_posts('cat=' . get_field( "offer_service-category" ) . '');
may be overwriting the posts in the “Main Query”, though I’m not sure about that to be honest.
Anyway, the problem is in the way the queries are nested and the use of resets. Basically, what you’re going to need to do is find another way to loop through the 3rd level query in you’re left and right template parts.
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.