WordPress.org

Ready to get started?Download WordPress

Forums

Can't find custom posts after switching themes (3 posts)

  1. kylemcburnie
    Member
    Posted 1 year ago #

    So I recently switched themes, and the old theme had a custom post type called "Portfolio."
    When I switched over themes the posts dissappeared, which wasn't a big deal because I can just re-make them. The problem, however, is that when I tried to remake the posts with the same permalink, it's already taken! (the permalink just redirects to a 404-page not found).
    Any idea where I can either find these custom posts and restore them as normal posts, or simply free up the permalink that was assigned to those old posts? I can't find them in my trash anywhere...
    Any help is greatly appreciated!

  2. Rachel
    Member
    Posted 1 year ago #

    Have you tried switching back to the old theme to see if the posts reappear? If they do, you can then use something like this plugin to convert the "portfolio" posts to another post type:

    http://wordpress.org/extend/plugins/convert-post-types/

    Then you should be able to switch to your new theme and still access those posts.

  3. johnfotios
    Member
    Posted 1 year ago #

    The Portfolio post type would have been registered in the functions.php of your old theme.

    In your new theme, register the post type again. If it's saying it's already taken, unregister the post type first.

    add_action( 'init', 'portfolio' );
    function portfolio() {
    	remove_action('init', 'portfolio');
    }

    Doing this might bring in the old posts or not. I would think it would as they'll still be in the database and should be assigned to the Portfolio post type.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.