shortcode with $atts with strange results

The functions you have above don’t use the id att at all. This might be what you want, but I’m not 100% sure what you’re going for. function show_homepage_banner_function($atts) { $atts = shortcode_atts( array(‘id’ => NULL), $atts ); $content=””; global $wpdb; $upload_url=””; $upload_dir = wp_upload_dir(); $target_dir = $upload_dir[‘basedir’]; $upload_url = $upload_dir[‘baseurl’].’/banners/’; $query = “SELECT * … Read more

Multiple Orderby is not working right

Your orderby is wrong and should be $args = array( ‘posts_per_page’ => 10, ‘post_type’ => ‘post’, ‘cat’ => $category->cat_ID, ‘paged’ => $paged, ‘meta_key’ => ‘featured_blog’, ‘orderby’ => array(‘meta_value_num’ => ‘DESC’, ‘date’ => ‘DESC’ ), );

How to order “top rated” results by date and meta key?

Your syntax is off – I can see you’re trying to add meta_value as an orderby param, but you’ve actually added as it an array entry – this is why formatting and indentation is important! $rate_query = new WP_Query([ ‘post_type’ => ‘movies’, ‘orderby’ => ‘date meta_value_num’, ‘meta_key’ => ‘wtf_rscore’, ‘posts_per_page’ => 14, ]);

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