Order posts by tags count?

As @Robert hue says you can’t do it directly, you need a filter and a CASE in the orderby eg $args1 = array ( ‘orderby’ => ‘tag_count’, ‘order’ => ‘DESC’, ‘post_type’ => ‘post’, ‘pagination’ => true, ‘posts_per_page’ => ‘1’, // 1 post per page?! ‘meta_key’ => ‘_thumbnail_id’, ‘suppress_filters’ => false, ); function wpse173949_posts_clauses( $pieces, $query … Read more

query posts with selected post ids first

I’m not sure if it’s possible to do this in a single query in WordPress. You could potentially split it into two like below: <ul> <?php global $post; // Get posts by selected post ids $args = array( ‘posts_per_page’ => -1, ‘post__in’ => [12345,12543], ‘orderby’ => ‘post__in’ ); $myposts = get_posts($args); foreach ($myposts as $post) … Read more

Order by value of Custom Field using url string

Try use get_query_var instead of $_GET and also increase priority function my_pre_get_posts( $wp_query ) { // do not modify queries in the admin if( is_admin() ) { return $wp_query; } // allow the url to alter the query if( isset(get_query_var( ‘budget’ )) ) { $wp_query->set(‘meta_key’, ‘budget’); $wp_query->set(‘meta_value’, get_query_var( ‘budget’ )); } // return return $wp_query; … Read more

How can I order these pages in this navigation bar on this old wordpress theme?

I suggest you change code of your greenday_get_menu_from_pages() function a little bit, just so that the results are not ordered by post_title which is default for get_pages(), but ordered by menu_order, which is what most “page ordering” plugins you have tested actually work with. So here is one new line in your function: function greenday_get_menu_from_pages() … Read more

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