How do I display posts of a specific day?

First things first. Do not you query_posts(). Use WP_Query instead, to prevent messing with the main query. Now, as for your question. WP_Query allows you to enter data parameters too. It even has a date query which you can check it out in the link I’ve provided. Instead of using Admin-AJAX, you can write a … Read more

Pagination does not work with query_posts()

the_posts_pagination works with the global $wp_query, so your second method will not work. query_posts modifies the main query but the arguments passed will overwrite any existing values, so all values needed for pagination are lost when you set cat=5. But you can preserve the existing values by modifying the global query string. A more efficient … Read more

WP_Query to get posts in a specific tag or has post_format

Try Below Code :- $query = new WP_Query(array( ‘posts_per_page’ => 2, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array( ‘post-format-link’ ) ), array( ‘taxonomy’ => ‘space’, ‘field’ => ‘term_id’, ‘terms’ => array(’16’), // 16 is the code for tag longform ‘operator’ => ‘IN’ ) ) ));

wp_query args with relation

I think your query is wrong post__not_in only accepts array of post_id’s only. I think it should be like this. $onemonth_before = date(‘Y-m-d’, strtotime(‘-1 month’)); $args = array( ‘tag__not_in’ => array(<pass tag_id here>), ‘date_query’ => array( ‘before’ = $onemonth_before, ‘inclusive’ = true, ), ); $query = new WP_Query($args);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)