How to display custom post type ordered by a custom field date

The correct array key to use is meta_key, not key. You can only use key as part of a meta_query subarray, where the ‘meta’ part is implied. This is all described in the codex. Try <?php $activities = new WP_Query( array( ‘post_type’ => ‘timeline’, ‘posts_per_page’ => -1, ‘meta_key’ => ‘activity-date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => … Read more

Changing posts order on a page

posts, in descending order by the title: this is a format of post order by it’s title to add title query_posts( array( ‘category__and’ => array(1,3), ‘posts_per_page’ => 2, ‘orderby’ => ‘title’, ‘order’ => ‘DESC’ ) ); And it’s your code want change global $post; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(array( ‘post_type’ => ‘staff-page’, … Read more

Add filter to Orderby Parameter using Array

Thanks karpstrucking, This was a simple case of me needing to understand the Query better. Once I fully understood that wp_query returns a string for the sql query, it was a simply case of doing what I needed to do to correction the event_date value, concatenating on the additional title or meta_num_value and returning that. … Read more

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