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.