最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can I create a Category Index page that lists all categories?

programmeradmin3浏览0评论

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/category/news/]. This is good and correct.

When I go to [www.example/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.

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/category/news/]. This is good and correct.

When I go to [www.example/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.

Share Improve this question asked Oct 12, 2018 at 15:24 PeterPeter 1351 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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.

发布评论

评论列表(0)

  1. 暂无评论