I seem to have run into a sort of odd issue with WP_Query post__in I can’t quite figure out. ANY help is appreciated! Goal/Progress so far: Overall I want to merge two arrays and use the merged array inside a WP_Query. I currently have two get_posts queries, one has 5 posts (can be any number), […]
Categories
Weird orderby => post__in issue
- Post author By Marcia D.
- Post date February 12, 2020
- No Comments on Weird orderby => post__in issue
- Tags 'field' => 'slug', 'fields' => 'ids', 'has_archive' => true ) ); List of tests i've done so far: If I remove 'orderby' => 'post__in' then the wp_query does o, 'operator' => 'NOT IN', 'orderby' => 'post__in', 'paged' => $paged, 'post__in' => $mergedArray, 'posts_per_page' => -1, 'posts_per_page' => 1330, 'posts_per_page' => 9, 'tax_query' => array( array( 'taxonomy' => 'blog_post_loc', 'terms' => 'blog-hub-page' ) ), ) ); $mergedArray = array_merge($queryOne, ) ); $queryTwo = get_posts( array( 'post_type' => 'post', // for some reason if we go higher than 1330 (or use -1) it breaks 'tax_query' => array( array(, $queryTwo); $blogLoop = new WP_Query( array( 'post_type' => 'post', and/or maybe there is some param I can use to remove that limit. Again any help at all is much appreciated. I've pretty much tested everythi, followed by second query) but i'm only getting about half of the total posts. My assumption: So what this all leads me to believe is either, however they are not the order i'm looking for. I also checked the count to see if this was indeed the merged array and it is and i can confi, I seem to have run into a sort of odd issue with WP_Query post__in I can't quite figure out. ANY help is appreciated! Goal/Progress so far:, if I only use the second query and I don't limit it at all, just tell it to grab all posts, one has 5 posts (can be any number), or B) post__in and orderby has some limit on the number of posts it can handle, so i'm then saying 'orderby' => 'post__in' to maintain the same order as the merged array. The issue is this only works if the $mergedArray t, so this tells me the actual args are fine. Even if we forget for a moment about the merging of the two arrays, the second has 2000+ posts. I'm then merging these and using the merged array inside WP_Query by saying 'post__in' => $mergedArray and I want, then I go to use that array inside my WP_Query through 'post__in' and keep orderby as well, then it still has the same issue where its just blank. If i remove orderby then it shows all posts in the array. If I limit the number of po, you will see I am using a custom taxonomy but this doesn't seem to affect the actual outcome overall. The issue persists with and without the