WordPress.org

Forums

[resolved] Custom post type loads home page, not archive page (2 posts)

  1. Nate
    Member
    Posted 11 months ago #

    I have a custom post type set up (two, actually) that are not displaying properly. I am hoping that it is the same issue with both post types.

    Here is my code for one of the post types (portfolio). The second is quite similar. http://pastebin.com/KZfNwytX

    Each post type is included in a separate file, and called to functions.php with an include command. These are showing up in the admin area perfectly, posts are being saved perfectly, etc. However, the theme files (archive-portfolio.php and single-portfolio.php) are not loading. Instead, my custom home page is being displayed. Here is a link to the portfolio page:

    http://new.cocode.org.uk/work/

    And the single post I have created:

    http://new.cocode.org.uk/work/test/

    I don't know what the issue would be. I have flushed the rewrite rules with each post type, and removing it does nothing either. I have only recently started with custom post types, so any assistance would be extremely helpful.

  2. Nate
    Member
    Posted 11 months ago #

    I have resolved the issue. It turned out that there was nothing wrong with the CPT code, but rather an issue I had earlier that had come back to bite me.

Reply

You must log in to post.

About this Topic