Learn how to modify the number of entries per page of a given category in WordPress using code.
WordPress allows you to choose how many posts you want to display per page (in Settings > Maximum number of entries to display on the site).
But what if you want to enter more or less posts from a particular category?
Well, thanks to WordPress’ conditional tags, you can do it easily.
Find out how:
Snippet to change the number of posts per page from a specific category
Add this fragment to the end of the functions.php file:
Ready! You will now display 12 posts from the ‘tutorials’ category per page.
Obviously, you can adjust both the category and the number of posts to your needs.
Now you know how to display the number of entries you or your client wants depending on their category.
If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.
Benefits of being a subscriber. 🙂