New answers tagged

0

To order posts by meta fields you will need something like : $args = array( "meta_query" => array( array( "key" => "youtube-views", ), ), "orderby" => "meta_value" ); Where you should use the name of the database column as key, usually it should be specified in key - value pairs, but you should be able to ...


0

https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters <ul> <?php $item=0; $attr = array( 'post_type' => 'lyrics', 'date_query' => array( array( 'after' => '1 month ago' ) ), 'post_status'=> 'publish', 'meta_key' => 'youtube_views', 'orderby' => 'meta_value', 'order' ...



Top 50 recent answers are included