title: Pagination problem on the homepage in wordpress
body: <p>I am using the following code for the homepage pagination. The problem is that the posts are not changing whenever I try to switch between the pages but I could see the pagination changes in the permalink. Can someone please help me to solve this issue?</p>
  <pre><code>&lt;?php
      $ourCurrentPage = get_query_var('page') ? get_query_var('page') : 1;
          $args = array(
            'post_type'=&gt; 'post',
            'order'    =&gt; 'DESC',
            'posts_per_page' =&gt; 4,
            'page' =&gt; $ourCurrentPage,
  
          );              
          $my_query = new WP_Query( $args );
          if($my_query-&gt;have_posts()) : while ($my_query-&gt;have_posts() ) : $my_query-&gt;the_post(); ?&gt;
      
      &lt;article id=&quot;post-&lt;?php the_ID(); ?&gt;&quot; &lt;?php post_class(); ?&gt;&gt;
          
                      &lt;div class=&quot;post-content&quot; data-aos=&quot;zoom-in&quot; data-aos-delay=&quot;200&quot;&gt;
                         -------------
                         -------------
                  &lt;/div&gt;
             
          
  &lt;/article&gt;&lt;!-- #post-## --&gt;
          &lt;?php endwhile; 
  echo paginate_links(array(
  'total' =&gt; $my_query-&gt;max_num_pages
  ));
  ?&gt;
  </code></pre>