The tag has no wiki summary.

learn more… | top users | synonyms

-1
votes
1answer
66 views

Resetting a Query using wp_reset_query() or wp_reset_postdata() does not work

I am using ACF as related posts. I have the following code. <?php $post_objects = get_field('repeater_related_items'); if( $post_objects ): ?> <ul> <?php foreach( $post_objects ...
1
vote
1answer
68 views

Should 'setup_postdata()' be reset with 'wp_reset_postdata()'?

Starting with an example makes more sense, so here's an example function: function seo_meta_tags() { global $post; if( is_singular() ) { setup_postdata( $post ); ...
0
votes
1answer
51 views

Optimizing multiple WP_querys into one call?

I have finished building my website and noticed due to the structure it takes 3 seconds to load the data due to each WP_query bouncing between different post types. I was wondering if I put these into ...
0
votes
2answers
219 views

Why is wp_reset_postdata() restarting the loop from the first post?

I've used the second-last example showed here: https://github.com/scribu/wp-posts-to-posts/wiki/each_connected The only difference is that I've put the_title after echoing the connected posts. So my ...
2
votes
1answer
921 views

Is it necessary to reset the query after using get_posts()?

Is it necessary to reset the query after using get_posts() ? I have been looking at this page and I don't see any reference to get_posts() ... I can't make it out for sure from this page either. I ...
1
vote
1answer
669 views

Is there any need to use both wp_reset_postdata and wp_reset_query together?

Is there any need to use both wp_reset_postdata() and wp_reset_query() together? Is it a case that I would pick one of the two functions; is there any point in doing this after a query : ...
0
votes
1answer
399 views

How to reset post data properly

I have this piece of code that I am calling within the loop to get image metadata ( title/caption and description ). It works fine but it only works for the first post in the loop. So I assume it ...