function devvn_wp_corenavi($custom_query = null, $paged = null) {
global $wp_query;
if($custom_query) $main_query = $custom_query;
else $main_query = $wp_query;
$paged = ($paged) ? $paged : get_query_var('page');
$big = 999999999;
$total = isset($main_query->max_num_pages)?$main_query->max_num_pages:'';
if($total > 1) echo '
';
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?page=%#%',
'current' => max( 1, $paged ),
'total' => $total,
'mid_size' => '7', // Số trang hiển thị khi có nhiều trang trước khi hiển thị ...
'prev_text' => __('Prev','devvn'),
'next_text' => __('Next','devvn'),
) );
if($total > 1) echo '
';
}
function get_custom_post_to_homepage() {
$posts = array(
'page' => $paged,
'cat' => 116,
'posts_per_page' => 15,
'order' => 'ASC',
);
$args = new wp_query( $posts );
// The Loop
if ( $args->have_posts() ) {?>
have_posts()) : $args->the_post();?>