# Template single Custom Post Type - get 404

**URL:** https://discourse.roots.io/t/template-single-custom-post-type-get-404/6918
**Category:** sage
**Created:** 2016-06-08T13:37:25Z
**Posts:** 4

## Post 1 by @dghez — 2016-06-08T13:37:25Z

Hi everyone.  
I created a new CPT with the `post_type` as `match` and I tried it into a loop in my `template-landing` and everything is fine.  
Now I need to create the `single-page of the match` so I did this:

1. copied and pasted `single.php` and changed the name as `single-match.php`, and inside this I changed the path of the `get_template_part` to the new `content-single-match.php`

2. copied and pasted `templates/content-single.php` and changed the name as `templates/content-single-match.php`

Now everything should be fine but if I open the single page of the CPT I get a 404 error.  
Can anyone see any error?  
Thanks!

---

## Post 2 by @mikespainhower — 2016-06-08T14:31:23Z

Did you try [https://codex.wordpress.org/Function\_Reference/flush\_rewrite\_rules](https://codex.wordpress.org/Function_Reference/flush_rewrite_rules)?

Re-saving your permalink options at /wp-admin/options-permalink.php should also do it.

---

## Post 3 by @dghez — 2016-06-08T15:10:58Z

That did the trick.  
Why did it happen? I mean, I didn’t set anywhere any option about the permalinks, now I set them as “post-name” and everything works.

---

## Post 4 by @mikespainhower — 2016-06-08T15:45:25Z

Because you didn’t flush the rewrite rules after post type registration.

Re-saving your permalink options (the specific settings aren’t relevant) is a quick way to flush them w/o calling `flush_rewrite_rules` in your code.

Also, this is standard WordPress stuff, unrelated to Sage.
