0

I don't find a way to have a template for my root category page ??

my archive.php file works great for any link such as:

http://adress.com/category/category-name

etc

but for http://adress.com/category/

I can not find the file who could edit that url ? at the moment I just have a 404...

Any idea ? I tried to add a template archive-slug.php without success :(

Thanks a lot for your help !

  • 1
    such a template does not exist. what would you expect that a template like that should show? – Michael Jul 15 '17 at 19:43
  • Hi Michael, thanks for answering. It should show all post from all categories, for SEO purpose I ve been told category should have a parent page ! How can it be done ? – thebigE Jul 15 '17 at 19:59
  • 1
    'all posts of all categories' would be the 'posts page', which is either the home page or a page which you can set via 'settings - reading' ... – Michael Jul 15 '17 at 20:55
1

You can't find it because it doesn't exist. There is no page at that location.

In WordPress everything is either an archive of posts or a post of some type. Pages are posts of type page etc. Date archives are archives of posts

So if you went to /category what would it show? For this reason there is nothing there to show. You would need to write a rewrite rule, manually load a template, and that's assuming it doesn't interfere with other rewrite rules

  • 1
    Thanks Tom, it should show the post of all categories. For SEO purposes I be been told category should have a parent template. How can this be done from rewrite rule ? Thanks :) – thebigE Jul 15 '17 at 19:58
  • 1
    I would consider whoever told you that to be talking complete BS. 27% of the web already works this way with no ill SEO effects. Trust me, you are heading down a painful path – Tom J Nowell Jul 15 '17 at 20:01
0

Your home page already shows posts from all the categories. The reason that you can't find anything in that path is that /category/ is a base term for categories, the same way /tag/ is for tags. You can check this in the permalink page, if you navigate to Settings > Permalinks.

There is only 1 condition that you can have a page that list every post from every category, and it's when you have a static home page. In that case, if you navigate to http://example.com/blog/ you will see a list of every post on your website. If you wish, you can redirect http://example.com/category/ to http://example.com/blog/.

However, be careful not to redirect any other path such as http://example.com/category/example/, and make sure you have a static page set as home page, or you will get stuck in an infinite loop.

But as @Tom already mentioned, a quarter of the internet runs on WordPress, and they don't have a SEO problem because of this. So, you can just forget about it ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.