Ecommerce Shopify WordPress Discussion

Problem while implementing pagination in wordpress query

I have been trying to make a news page with my posts and looking to implement pagination in WordPress. This is what I tried so far: <div class="page-header" id="page-header=news"> <h1>News</h1> </div> <?php $args = array( 'post_type' => 'post', // Change 'post' to your custom post type if you have one 'posts_per_page' => 10, // Number of posts to display ); $query = new WP_Query($args); if ($query->have_posts()) : /* Start the Loop */ while ($query->have_posts()) : $query->the_post(); /* * Include the Post-Type-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Type name) and that will be used instead. */ get_template_part('template-parts/content', get_post_type()); endwhile; ?> <div class="pagination"> <?php the_posts_pagination(array( 'next_text' => __('Next page', 'mothertongues'), 'prev_text' => __('Previous page', 'mothertongues'), )); ?> </div> <?php wp_reset_postdata(); // Reset the post data else : get_template_part('template-parts/content', 'none'); endif; ?> But it's not working, while I am able to get the posts, the pagination in itself does not load. any help would be super appreaciated.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.