简体   繁体   中英

What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?

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

It's very likely that blank white page is actually caused by a fatal error on one of your templates. You should enable PHP's error debugging during development to help track down these issues.

You should be able to enable errors with php by creating a file php.ini in the root directory of wordpress install. The php.ini file should read

error_reporting E_ALL
display_errors On

I believe the template you'd want, to target that archive specifically, would be archive-legacy-posts.php, though you could also try category-legacy-posts.php. Please note, in either of these, after archive or category the slug should follow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM