Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.


I'm building a website in which there is a page where I collect a list of works/projects; I created a file called work.php where I made the template of this page, but when I try to view a single custom post (when I press on a single item), it says that the page doesn't exist.

Then, my question is: do I have to create a custom template like work-post.php for the custom post or do I have to use single.php?

P.S. I'm using a custom post called work type I made.

share|improve this question
    
It isn't clear what you are doing. Do you have a CPT called "work"? –  s_ha_dum Dec 29 '13 at 17:26

2 Answers 2

You have to create a custom single page file. Or search about template post in wordpress.

share|improve this answer

If you CPT is called "work", i.e. you have registered it using

register_post_type('work', $args);

you have to create a file called 'single-work.php' and that will be used to show the singular work post.

If you don't create that file the file 'single.php',if present, will be used by WordPress. If even the 'single.php' does not exist in your theme, then the 'index.php' file will be used.

Please see WordPress Template Hierarchy on Codex for more info.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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