Title: Can&#8217;t view posts after hard coding post types
Last modified: February 21, 2017

---

# Can’t view posts after hard coding post types

 *  Resolved [Stefan](https://wordpress.org/support/users/stefan83/)
 * (@stefan83)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/cant-view-posts-after-hard-coding-post-types/)
 * I’ve just used the ‘get code’ functionality to generate the PHP for my custom
   posts types defined with this plugin. But now I can’t view the posts and viewing
   the archive redirects me to the homepage. Any ideas why and how I can fix this?
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [9 years, 3 months ago](https://wordpress.org/support/topic/cant-view-posts-after-hard-coding-post-types/#post-8831093)
 * First question that comes to mind is just confirming where you placed the generated
   PHP. In case it’s not getting loaded at all.
 * Second is if you deactivated CPTUI or not. If it’s still active, then it should
   be registering it for you still.
 * Third question is if the slugs are matching, or if something may have caused 
   them to change.
 * For what it’s worth, all the content should still be in the database. We don’t
   do any post/term deletion. Just always a matter of getting things lined up properly
   again.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [9 years, 3 months ago](https://wordpress.org/support/topic/cant-view-posts-after-hard-coding-post-types/#post-8882441)
 * Any followup for this one [@stefan83](https://wordpress.org/support/users/stefan83/)?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Can’t view posts after hard coding post types’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/cant-view-posts-after-hard-coding-post-types/#post-8882441)
 * Status: resolved