I modified the index.php file to display pagination, but now does not work properly when I click on any category, how I can get the category and add it to the query?
<?php get_header(); ?>
<section class="post-list box-siz rounded">
<?php
$temp = $wp_query;
//$wp_query = null;
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$tag = ( get_query_var( 'tag' ) ) ? get_query_var( 'tag' ) : null;
$args = array(
'posts_per_page' => 5,
'paged' => $paged,
'tag' => $tag,
'orderby' => 'date',
'order' => 'DESC',
);
$wp_query = new WP_Query($args);
?>
<?php if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
Try to add this to your code:
keep in mind, category_name is a slug not a name.