Pagination on archive.php page

I think your issue is that wp_pagenavi() is doing pagination based off of the global $wp_query instance instead instance you created. You should either switch to using query_posts() to replace the global query instead, or use WordPress’ built in paginate_links to output the paging.

Number of posts per page setting is not working?

This could be caused by a theme or plugin overriding the WordPress settings. You could try enabling the TwentyEleven or TwentyTen theme, as well as disabling any plugins, to see if it works then. If so, you could post which theme you are using (if it’s prebuilt) or which plugins you had to disable to … Read more

Meta Query with date and time on the same Day before given time

Found the error: $args = array( “posts_per_page” => 12, “paged” => $paged, “post_type” => array( “event”, “post” ) , “post_status” => “publish”, “meta_key” => “_thumbnail_id”, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘event_start’, ‘value’ => date(“Y-m-d H:i:s”) , ‘compare’ => ‘>=’, ‘type’ => ‘DATETIME’ ) , array( ‘key’ => ‘event_start’, ‘compare’ => ‘NOT … Read more

How to get previous 10 days post from a specific date – WP Query

Yes, it is possible. You can pass full date as before and after params, so: $given_date_as_time = strtotime(‘2017-11-22 00:00:00’); $args = array( ‘post_type’ => ‘post’, ‘date_query’ => array( ‘before’ => date( ‘c’, $given_date_as_time ), ‘after’ => date(‘c’, strtotime( ‘- 10 days’, $given_date_as_time ) ), ), ); $query = new WP_Query( $args ); above query is … Read more

Sort X categories by last update and show image

Here’s one solution: global $wpdb; $cat_array = $wpdb->get_results( ” SELECT terms.*, posts.ID as post_ID FROM wp_terms terms JOIN wp_term_taxonomy term_taxonomy ON terms.term_id = term_taxonomy.term_id JOIN wp_term_relationships term_relationships ON ( term_relationships.term_taxonomy_id = term_taxonomy.term_taxonomy_id AND term_taxonomy.taxonomy = ‘category’ ) JOIN wp_posts posts ON ( posts.ID = term_relationships.object_id AND posts.post_type=”post” AND posts.post_status=”publish” ) GROUP BY terms.term_id ORDER BY … Read more

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