The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
65 views

Custom WP_Query not working correctly

OK, So I have created a custom WP_Query that gets the post_type post and outputs it as a styled list. It works well and outputs the styled list but then underneath it displays all the posts again but ...
0
votes
2answers
40 views

Sort order in get_posts [closed]

I've created a custom template for a client. This is going to be a multilingual site setup on a Multisite install. As you can see under each category letter, the posts start out in alphabetical order ...
0
votes
0answers
54 views

Ajax doesn't work on second call

I'm using Ajax to load posts into a sidebar that are filtered by a chosen category. It works perfectly fine the first time, but for some reason the second time it loads a mixture of results from the ...
2
votes
1answer
408 views

wp_reset_postdata() or wp_reset_query() after a custom loop?

Reading som stuff about query_reset_postdata and query_reset_query makes me confused... For example: 1) Is there any need to use both wp_reset_postdata and wp_reset_query together? ...
-1
votes
1answer
307 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
129 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
65 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
423 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
1k 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
738 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
452 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 ...