0


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.

1
  • It isn't clear what you are doing. Do you have a CPT called "work"?
    – s_ha_dum
    Commented Dec 29, 2013 at 17:26

2 Answers 2

1

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.

0

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

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.