function custom_pagination($numpages = '', $pagerange = '', $page='') {
if (empty($pagerange)) {
$pagerange = 2;
}
if ($numpages == '') {
global $wp_query;
$numpages = $wp_query->max_num_pages;
if(!$numpages) {
$numpages = 1;
}
}
$pagination_args = array(
'base' => get_pagenum_link(1) . '%_%',
'format' => 'page/%#%',
'total' => $numpages,
'current' => $page,
'show_all' => true,
'end_size' => 1,
'mid_size' => $pagerange,
'prev_next' => false,
'prev_text' => false,
'next_text' => false,
'type' => 'plain',
'add_args' => false,
'add_fragment' => ''
);
$paginate_links = paginate_links($pagination_args);
if ($paginate_links) {
echo "<div class='pagination'>";
echo $paginate_links;
echo "</div>";
}
}
if ( is_front_page() ) {
$paged = ( get_query_var('page') ) ? get_query_var('page') : 1;
}
else {
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
}
$args = array(
'posts_per_page' => 4,
'post_type' => 'news',
'paged' => $paged,
'page' => $paged,
);
// тут код вывода записей
// а это пагинация
custom_pagination($the_query->max_num_pages, "", $paged);
google.maps.event.addListener(marker, 'click', function() {
// вызываем попап
});