2

Our existing corporate site was developed by a 3rd party vendor. I am in the process of creating a new version of our site, in a new WP instance. I need to export the 'News' articles, from the current site, to the new DEV site. My issue is I cannot find, on the current site, where the 'News' custom post type was created/configured. When I click on 'News', in the current site, the post type URL displays as: post_type=recent-news. And, when importing into the new DEV site, I receive this error: 'Invalid post type recent-news'.

  1. Does the import custom post type plugin need to be the same as the export custom post type plugin?

I'm using CPT UI on the DEV site, and the only custom post type plugin I can find on the current site is Toolset. but, in the Toolset settings, the only post types that display are OOTB post types of: Media, Pages, and Posts. there is no reference to either 'News' or 'recent-news'.

  1. I've tried creating a new custom post type, on DEV, using CPT UI, but I cannot figure out how to specify the post type as 'recent-news', in order to match what is being imported. CPT UI always converts a dash '-' to an underscore '_'?

Am I missing something, or did the 3rd party developer hard code a 'News'/'recent-news' post type somewhere else?

I'm not a true 'developer', I'm more of a front-end guy, so I'm racking my brain trying to figure this out.

  • 1
    Do you know that the recent-news CPT was created using a plugin at all? It may be created in the theme code itself. – vancoder May 28 at 21:31
  • You can also check the functions.php of the active theme for any code that might add the custom post type and get clues from that. – montrealist May 28 at 23:56
  • Hi, and thanks for the reply. I don't think it was created using a plugin, as I can't find any reference to 'recent-news' anywhere. I will check the functions file and see if there's a clue there. – Brian May 29 at 18:15
  • 1
    found it, hard coded, in a '/lib/custom.php' Custom Functions file. do I simply add this to the functions.php file, in my Child Theme? – Brian May 29 at 18:28
  • /* Core Custom Post Type */ add_action('init', 'custom_post_type'); function custom_post_type() { global $roots_options; // custom register_post_type( 'recent-news', array( 'labels' => array( 'name' => __( 'News' ), 'singular_name' => __( 'News' ), 'add_new' => __( 'Create New' ), 'add_new_item' => __( 'Create New News' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit News' ), 'new_item' => __( 'New News' ), 'add_new_item' => __( ' Add New News' ), – Brian May 29 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.