1

I have themed my category.php file so it now displays all posts that belong to the category that was clicked. The URL looks like [www.example.com/category/news/]. This is good and correct.

When I go to [www.example.com/category/] I am expecting to find a Category index page that lists all created categories but I receive a 404.

I have looked in the WP Codex and have not found anything that can help me create a Category index page. Is this possible? If so how do I go about starting? Please forgive me if this has already been answered as I may not be asking the right things.

NOTE: I know that I will be using the wp_list_categories function so that is not the question.

1 Answer 1

1

1 - Create a custom template file in your theme e.g "my-custom-template.php"

2 - Create a page from the dashboard, and in the page attributes box(Right sidebar), select the custom template you've juste created as a Model.

3 - use wp_list_categories to get the list of your available categories...

hope this helps you out.

2
  • Thank you for your response. I had given thought to this but I wanted to check and see if there was a function or built in WP method I had not seen that I could use to achieve this result.
    – Peter
    Oct 12, 2018 at 15:42
  • 1
    @Peter you welcome, I have never heard about a function doing that, instead there is some plugins that can do this... I think it's better you do it like I suggested above, because you will have a full control about the rendered html... Oct 12, 2018 at 16:00

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.