Standard Loop – wp_query

Yes you need some arguments defined. A good place to easily get your loops defined is: https://generatewp.com/wp_query/ Here’s an example of some arguments used. // WP_Query arguments $args = array ( ‘post_type’ => array( ‘post’ ), ‘nopaging’ => true, ‘posts_per_page’ => ‘3’, ‘ignore_sticky_posts’ => true, ); // The Query $query = new WP_Query( $args ); … Read more

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’ ), );