<?php
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$news= new WP_Query(array(
\'post_type\'=>\'post\',
\'posts_per_page\' => 3,
\'paged\' => $paged,
));
if($news->have_posts()) :
while($news->have_posts()) : $news->the_post();
the_title();
endwhile;
$total_pages = $news->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var(\'paged\'));
echo paginate_links(array(
\'base\' => get_pagenum_link(1) . \'%_%\',
\'format\' => \'/page/%#%\',
\'current\' => $current_page,
\'total\' => $total_pages,
\'prev_text\' => __(\'« prev\'),
\'next_text\' => __(\'next »\'),
));
}
?>
<?php else :?>
<h3><?php _e(\'404 Error: Not Found\', \'\'); ?></h3>
<?php endif; ?>
<?php wp_reset_postdata();?>