Wordpress Pagination does not work

admin

Administrator
Staff member
I am trying to create a wordpress theme, but I am not able to make the pagination work on the live version. On the localhost it's working just as expected, but on the live version it gives a 404 page each time. I know that there is a lot of answers about this topic, but I was not able to fix my problem. I've already tryed the following topics, among so many others but none of them helped me:
<blockquote>
<ul>
<li><a href="https://stackoverflow.com/questions...-custom-post-type-query?noredirect=1&amp;lq=1">How to include pagination in a Wordpress Custom Post Type Query</a>
</li>
<li><a href="https://stackoverflow.com/questions/41397510/wp-paginate-links-and-query-vars-not-working-wordpress">wp paginate_links and query vars not working Wordpress</a>
</li>
</ul>
</blockquote>
I would like to know if you guys can help me to figure out what I am missing here. I am trying to show my navigation panel at index file(my blog page).
Code:
get_header(); ?&gt;

&lt;div id=&quot;primary&quot; class=&quot;container&quot;&gt;
    &lt;main id=&quot;main&quot; class=&quot;col-xs-12&quot;&gt;
        &lt;h3 class=&quot;title text-center&quot;&gt;Notícias:&lt;/h3&gt;

        &lt;?php 
            global $wp_query;
            query_posts(
                array_merge( array(
                    'post_type' =&gt; 'news',
                    'orderby' =&gt; 'date',
                    'order' =&gt; 'DESC',
                    'posts_per_page' =&gt; 3
                ),$wp_query-&gt;query)
            );

            while($wp_query-&gt;have_posts()) :
            $wp_query-&gt;the_post();

            get_template_part('template-parts/content', 'news');

            endwhile; 
        ?&gt;
        &lt;div class=&quot;text-center paginate&quot;&gt;
            &lt;?php 
                if(function_exists('wp_paginate')):
                    wp_paginate();  
                endif;
             ?&gt;
        &lt;/div&gt; &lt;!-- .tect-center / Paginate--&gt;
        &lt;?php  wp_reset_postdata();  ?&gt;
    &lt;/main&gt;&lt;!-- #main --&gt;
&lt;/div&gt;&lt;!-- #primary --&gt;
&lt;?php
get_footer();
Right now I am using
Code:
Wp-paginate
plugin, but using
Code:
paginate_links()
functions gives me the same error, but both of them work on localhost. For the paginate link I've used the example from docs:
<blockquote>
<a href="https://codex.wordpress.org/Function_Reference/paginate_links" rel="nofollow noreferrer">https://codex.wordpress.org/Function_Reference/paginate_links</a>.
</blockquote>
Can somenon help me on that, please?