WP_Query->request has a limit

Use the posts_per_page parameter in your WP_Query to show a given number of posts. When you don’t provide this parameter, the query takes default value which can be set in backend on https://example.com/wp-admin/options-reading.php.

problem with loop

i think you are missing semicolons on flowing code. i have added semicolons. <div class=”headdark”><h3>Places nearby <?php echo the_title();?> </h3></div> <header class=”thumb-header”><a href=”https://wordpress.stackexchange.com/questions/244872/<?php the_permalink(get_the_ID()); ?>” class=”hover-img”> <div class=”thumb-caption”> <h5 itemprop=”name” class=”thumb-title”><a class=”text-darken” href=”<?php the_permalink() ;?>”><?php the_title();?></a></h5> and you have used {} but in flowing code you use ** : ** in closing logic <?php else … Read more

Query by date from custom field

There is an argument meta_compare. Use it for comparison. $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘matches’, ‘meta_key’ => ‘date’, ‘meta_compare’ => ‘>’, ‘meta_value’ => ‘2016-11-12’, ‘type’ => ‘DATE’ );

Does WP_Query ‘responds’ badly to empty arguments?

I would not write it the same way, because the more cluttered a query gets, the more likely it is to return unexpected results. Here’s how I’d handle your code: $args = array(); // All your WP_Query args go here. // You don’t need to pass ‘post_status’ => ‘publish’ because that’s default // Replace all … Read more

WP_Query to get post on frontpage

If you’re trying to get a post with the id of 32, the parameter you would use is p, which is one of the Post & Page Parameters. tag_id is used for querying posts with a particular Tag ID. $args = array( ‘post_type’ => ‘post’, ‘p’ => 32 ); $fp_post = new WP_Query( $args ); … Read more