How to display post and category stats and how to browse only through the same category?

Hello, I’ve made a pretty simple website using the latest 2023 theme with the latest WordPress and have a few simple questions.

1. The most important question and something I really need is the ability to browse only from the same category with the next and previous posts.

So far I have 6 different categories and each has 20+ posts and will get at least one per week, So when you open a single post from one category (for example “basketball”) I want to keep the user only in that category when clicking previous or next button at the bottom of the page which I added from Gutenberg blocks.

Right now it goes through all the posts from all the categories, so my question is how to limit it to stay in the category from the post you opened (if you opened “basketball news 5” stay in the category basketball and on the previous post go to “basketball news 4” or on next “basketball news 6”)

2) Can I display stats on each post like word count, time to read, etc… I can see those stats when I open each post at the top menu (image below)

Can I show some of these stats to users that are reading the post, is there some code I can use since it already exists?


3) On the category page where I am displaying all the posts from the said category, can I also get stats to show to users for example, the numbers of existing posts in that category , word count from all the posts etc…

The first question is the most important one since it is the main function of my site because each posts will be continuation from the previous one in the same category, so if it jumps from category A to B when browsing posts will be a bad design and bad user experience.


Edit: I managed to solve question number one, by adding, get\_next\_post( $in\_same\_term = true,), I added it site wide thought, but I don’t need it other way around…


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer