WordPress.org

Ready to get started?Download WordPress

Forums

Custom post types - 404 error (7 posts)

  1. dan.lee@uk-cpi.com
    Member
    Posted 1 year ago #

    I recently upgraded to the latest version of WordPress (3.5.1) and then discovered that custom post types that are created through the plugin “Types” were not working. I then installed Pods to see if I could use that instead and I have the same issue. The data is stored but it wont show. All I get is a 404 page.

    Does anyone have any idea what might be happening?

  2. curlybracket
    Member
    Posted 1 year ago #

    Does your site use permalinks?

    Try deactivating them. Does it work now?

    Do you use any other plugins which might conflict, like for example the No category base plugin?

  3. dan.lee@uk-cpi.com
    Member
    Posted 1 year ago #

    Thanks for replying. I tried deactivating all plugins to check conflicts, still the same thing happens.

    So I changed the permalinks settings to use ID instead and it works. Ideally though I want to use pretty urls. Still not sure why it might not work. Narrowed it down a bit!

  4. curlybracket
    Member
    Posted 1 year ago #

    I had a similar issue on a website i created.

    It depends on how the custom post type is created and if there are other plugins that interfere with the permalink creation.

    In the permalink section, what did you define ?

    On the problematic website I had something like this :
    personalized structure : http://mysite.com/%postname%/
    Which i needed to change to http://mysite.com/article/%postname%/

    Then the custom post types were accessible like this :
    http://mysite.com/article/myposttype/particularpost
    or like this : http://mysite.com/?myposttype=particularpost

    This was caused by the no category base plugin which added some strange rewrite rules to the .htaccess file at the web site root.

    However, i confirm that on other websites I am working on, custom post types work just fine with normal permalinks.

  5. Scott Kingsley Clark
    Member
    Posted 1 year ago #

    @dan, try switching your permalinks back to use the 'pretty urls' and confirm you have an .htaccess file on your site's root folder. If you don't see one, you'll want to read about that issue here:

    http://codex.wordpress.org/Using_Permalinks#Fixing_.htaccess_Generation_Issues

  6. dan.lee@uk-cpi.com
    Member
    Posted 1 year ago #

    @Scott, permalinks are "pretty urls" and the htaccess file is in the root but still having the same issue.

    I have custom posts defined in a functions file. I removed these just in case there was conflicts too but no luck there.

  7. curlybracket
    Member
    Posted 1 year ago #

    @dan.lee@uk-cpi.com try to generate clean code for your post type here http://generatewp.com/post-type/ (that site is great, really). Compare to your own code.

Topic Closed

This topic has been closed to new replies.

About this Topic