How do I use pagination in WordPress?

As in the comments, it’s not clear why you can’t use the options: dashboard -> settings -> reading -> Blog pages show at most [] posts However, if it is necessary that this be done via altering the query (say to target only specific pages, or archives) then this should really be done on pre_get_post: … Read more

Count custom post type based on two meta data

$args = array( ‘post_type’ => ‘appointments’, ‘meta_query’ => array( ‘relationship’ => ‘AND’, array( ‘key’ => ‘location’, ‘value’ => $place //set this somewhere ), array( ‘key’ => ‘timestamp’, ‘value’ => $time //set this somewhere ) ) ); $posts = new WP_Query( $args ); Docs: WP_Query You have the flexibility to add just about anything else you … Read more