wp_query ignoring custom post_status
I had the same issue and the reason was that I was running the query before registering the post status. So the post status was not registered and thus ignored in WP_Query
I had the same issue and the reason was that I was running the query before registering the post status. So the post status was not registered and thus ignored in WP_Query
wp_query ‘s’, search filter with pagination is not working
category_name is for category taxonomy, sense products use the product_cat you will need to add a tax_query into $args. Like this. $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 20, ‘tax_query’ => [ ‘taxonomy’ => ‘product_cat’, ‘field’ => ‘name’, ‘terms’ => ‘trofee’, ], ‘meta_query’ => array( ‘relation’ => ‘OR’, array( // Simple products type ‘key’ … Read more
WordPress Pagination changes my template
WP_Query orderby author__in
Sorting events by descending date, and ascending time if multiple events on a date
The problem was with my code. I was using wp_reset_postdata() before a section that shows the post title, which made it look like the WP_Query wasn’t working. Here’s my code now (it’s a slider that shows latest posts, and the regular feed shows scheduled posts). I updated my question with my new code
WP_Query sorted by custom taxonomy
I re-factored your code, there were quite some parts which seemed overly complex or used deprecated methods. In the code below, I’m looping through your terms, and within that loop, I’m finding the posts relating to that term. Probably there’s a more efficient way, since this is using several queries, but it should achieve the … Read more
Serve specific “template” page at any URL that ends in its slug