I've created a custom category.php
for my client. The issue is, that if I click to next/prev pagination links, it shows the same posts. Any idea what can be wrong?
category.php
<?php
/* Category template file */
get_header();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$the_query = new WP_Query( 'posts_per_page=2&paged=' . $paged );
?>
<div id="content">
<img id="eu-logo" src="<?php bloginfo('template_url')?>/img/title.png" />
<div class="article">
<?php global $post;
$args = array('category' => 11, 'posts_per_page' => 2, 'order_by' => 'date');
$custom_posts = get_posts($args);
foreach($custom_posts as $post) : setup_postdata($post);
echo "<div class='post'><h2 class='article__title'><a href='";
the_permalink();
echo "'>";
the_title();
echo "</a></h2>";
the_excerpt();
echo "</div>";
endforeach;
echo "<div id='forum-link'>";
echo "<a class='custom-nav' href='https://test.com'>Main Page</a><br />";
echo "<a class='custom-nav' href='https://test.com/forum/'>Forum</a>";
echo "</div>";
?>
</div>
<div><?php next_posts_link('Next Page »') ?></div>
<div><?php previous_posts_link('« Previous Page') ?></div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
'paged'
element in$args = array('category' => 11, 'posts_per_page' => 2, 'order_by' => 'date');