Multiple Demo Import
-
Hello,
First of all, thanks for your plugin. I am currently using your awesome plugin for demo import on my theme. But, while using multiple demo imports, the log file shows following error:
—Importing customizer settings—
Error: The customizer import file is not in a correct format. Please make sure to use the correct customizer import file.The code I have used for pre-defining the demos from theme is pasted below:
/** Import content data*/ if ( ! function_exists( 'lawyer_landing_page_pro_import_files' ) ) : function lawyer_landing_page_pro_import_files() { return array( array( 'import_file_name' => 'Default Layout', 'local_import_file' => get_template_directory() . '/inc/demo/content/default/lawyerpro.xml', 'local_import_widget_file' => get_template_directory() . '/inc/demo/content/default/lawyerpro.wie', 'local_import_customizer_file' => get_template_directory() . '/inc/demo/content/default/lawyerpro.dat', 'import_preview_image_url' => get_template_directory_uri() . '/screenshot.png', 'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'lawyer-landing-page-pro' ), ), array( 'import_file_name' => 'One Page Demo', 'local_import_file' => get_template_directory() . '/inc/demo/content/one-page/lawyerpro.xml', 'local_import_widget_file' => get_template_directory() . '/inc/demo/content/one-page/lawyerpro.wie', 'local_import_customizer_file' => get_template_directory() . '/inc/demo/content/one-page/lawyerpro.dat', 'import_preview_image_url' => get_template_directory_uri() . '/inc/demo/content/one-page/screenshot.png', 'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'lawyer-landing-page-pro' ), ), ); } add_filter( 'pt-ocdi/import_files', 'lawyer_landing_page_pro_import_files' ); endif; /** Programmatically set the front page and menu */ if ( ! function_exists( 'lawyer_landing_page_pro_after_import' ) ) : function lawyer_landing_page_pro_after_import( $selected_import ) { if ( 'Default Layout' === $selected_import['import_file_name'] ) { //Set Menu $primary = get_term_by('name', 'Primary', 'nav_menu'); $secondary = get_term_by('name', 'secondary', 'nav_menu'); set_theme_mod( 'nav_menu_locations' , array( 'primary' => $primary->term_id, 'secondary' => $secondary->term_id ) ); }elseif ( 'One Page Demo' === $selected_import['import_file_name'] ) { //Set Menu $primary = get_term_by('name', 'Primary', 'nav_menu'); $secondary = get_term_by('name', 'Primary', 'nav_menu'); set_theme_mod( 'nav_menu_locations' , array( 'primary' => $primary->term_id, 'secondary' => $secondary->term_id ) ); } /** Set Front page */ $page = get_page_by_path('when-the-stakes-are-high-we-can-help-you'); /** This need to be slug of the page that is assigned as Front page */ if ( isset( $page->ID ) ) { update_option( 'page_on_front', $page->ID ); update_option( 'show_on_front', 'page' ); } /** Blog Page */ $postpage = get_page_by_path('blog'); /** This need to be slug of the page that is assigned as Posts page */ if( $postpage ){ $post_pgid = $postpage->ID; update_option( 'page_for_posts', $post_pgid ); } } add_action( 'pt-ocdi/after_import', 'lawyer_landing_page_pro_after_import' ); endif;The import process gets executed successfully but after completing it shows the above error (mentioned earlier). Because of which the customizer settings are not being imported. Would you please help me resolve this?
Thanks and Kind regards,
The topic ‘Multiple Demo Import’ is closed to new replies.