query_posts() vs get_posts() multiple loops [duplicate]

Thanks to tips given by the commentators I was able to achieve this 🙂 <?php if ( is_front_age() ){ $most_viewed_posts = new WP_Query( array(‘v_sortby’ => ‘views’, ‘v_orderby’ => ‘DESC’, ‘showposts’ => 10, ‘cat’=> 3) ); } while ( $most_viewed_posts->have_posts() ) : $most_viewed_posts->the_post(); ?> //post structure <?php wp_reset_postdata(); ?>

Pagination – works on local but not live dev!

try this <?php //global $wp_rewrite; $loop->query_vars[‘paged’] > 1 ? $current = $loop->query_vars[‘paged’] : $current = 1; $pagination = array( ‘base’ => @add_query_arg(‘page’,’%#%’), ‘format’ => ”, ‘total’ => $loop->max_num_pages, ‘current’ => 0, ‘show_all’ => true, ‘prev_next’ => true, ‘prev_text’ => __(‘&laquo; Back’), ‘next_text’ => __(‘Newxt&raquo;’), ‘type’ => ‘plain’ ); if( $wp_rewrite->using_permalinks() ) $pagination[‘base’] = user_trailingslashit( trailingslashit( … Read more