global $wp_query;
$result = $wp_query;
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$original_query = $wp_query;
$wp_query = null;
$args=array(
\'post_type\'=> \'post\',
\'orderby\' => \'ID\',
\'post_status\' => \'publish\',
\'order\' => \'DESC\',
\'posts_per_page\'=>get_option( \'posts_per_page\' ),
\'paged\'=>$paged
);
$wp_query = new WP_Query( $args );
$result = new WP_Query( $args );
if ( $result-> have_posts() ) : ?>
<?php while ( $result->have_posts() ) : $result->the_post();
get_template_part( \'template-parts/content\', get_post_type() );
endwhile;
echo "<div class=\'pagenum_link\'>";
$total_pages = $result->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\' => __(\'«\'),
\'next_text\' => __(\'»\'),
));
}
echo "</div>";
else :
get_template_part( \'template-parts/content\', \'none\' );
endif;
wp_reset_postdata(); ?>