0

I am pretty new in WordPress theme development and I have the following doubt.

I am working on this custom theme: http://lnx.asper-eritrea.com/

Into this website upper horizontal main menu I have a link named LEGACY-POSTS (the last one) that should show the list of all the posts belonging to a specific category (named legacy-posts).

Clicking on this link I obtain a white empty page: lnx.asper-eritrea.com/category/legacy-posts/

I think that it could depend by the fact that maybe I have to implement this page. Is it right?

I was looking on the Template Hierarchy official WordPress documentation page: http://codex.wordpress.org/Template_Hierarchy

But I am finding some difficulties to understand what name I have to use for the file that implement this page.

Can you help me?

Tnx

4
  • Do you have archive.php or category.php in your theme which is empty?
    – bravokeyl
    Jul 26, 2014 at 16:44
  • yes, these 2 files are empty Jul 26, 2014 at 16:45
  • it seems you have archive.php in the theme which is empty.Am i correct?
    – bravokeyl
    Jul 26, 2014 at 16:45
  • 1
    category.php file is used to render posts belonging to specific category.since it is empty ..you are getting a blank page
    – bravokeyl
    Jul 26, 2014 at 16:46

1 Answer 1

2

A custom template for one specific category should be named category-slug.php where "slug" is the WP slug for the category. WordPress will automatically use this file to display the archive for that one category.

You could also name it using the ID of the category.

If your category is "legacy-posts", then your template file should be named category-legacy-posts.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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