Archived topic
404 with category without any post
5 replies · Started by Hans on December 15, 2018
I use a menu item for categories. Sometimes there are no posts in the category. Instead of a message that there are no posts I get a 404 error. What can I do to avoid this behaviour and to get an appropriate message?
Hi there,
It should use the No Results template by default.
So if you add a post to that category now and leave the URL as is, the post shows up?
You are right. It shows the no reult template - sorry. I would prefer to show a message, that there is no result for the query. How can I do so?
You can make a copy of this file: https://github.com/tomusborne/generatepress/blob/2.2.1/no-results.php
Then upload it to your child theme root directory.
Then you can go right into the file and make any needed changes.
Let me know if you need more info :)
Thank you - this will help!
You're welcome :)