• Resolved webhuntsupport

    (@webhuntsupport)


    Hello,

    i’m using a “One Click Demo Importer” plugin to import demo site.

    but i can’t properly import files while i using local import files (from theme folder)?

    See below code:

    <?php
    function thme_import_files() {
      return array(
        array(
          'import_file_name'             => 'Demo Import 1',
          'local_import_file'            => trailingslashit( get_template_directory() ) . 'inc/eocdi/demo-content.xml',
          'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'inc/eocdi/widgets.json',
          'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'inc/eocdi/customizer.dat',
          'import_preview_image_url'     => trailingslashit( get_template_directory() ) . 'screenshot.png',
          'import_notice'                => __( 'Save time by import our demo data, your website will be set up and ready to customize in minutes.', 'text-domian' ),
          'preview_url'                  => 'https://www.demo.webhuntinfotech.com/themename',
        ),
      );
    }
    add_filter( 'pt-ocdi/import_files', 'thme_import_files' );
    function thme_after_import_setup() {
        // Assign front page and posts page (blog page).
        $front_page_id = get_page_by_title( 'Home' );
        $blog_page_id  = get_page_by_title( 'Blog' );
    
        update_option( 'show_on_front', 'page' );
        update_option( 'page_on_front', $front_page_id->ID );
        update_option( 'page_for_posts', $blog_page_id->ID );
    	
    	// Assign menus to their locations.
        $main_menu = get_term_by( 'name', 'Primary Menu', 'nav_menu' );
        $top_menu = get_term_by( 'name', 'Top Menu', 'nav_menu' );
        set_theme_mod( 'nav_menu_locations', array(
    			'primary' => $main_menu->term_id,
    			'top' => $top_menu->term_id,
    		)
        );
    }
    add_action( 'pt-ocdi/after_import', 'thme_after_import_setup' ); ?>

    When i’m open log file its showing below error :

    Error : The customizer import file is not in a correct format. Please make sure to use the correct customizer import file.

    See log file here

    See customizer.dat file here

    See demo-content.xml file here

    See widgets.json file here

    Please provide soloution ASAP.

    Thank You

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    There is something wrong with the .dat file (customizer import file). When you want to unserialize it, you get this error: “unserialize(): Error at offset 1790 of 1794 bytes”.

    Please try to export a new customizer settings file. If that does not work for you, then inspect the file in detail and see if you can sopt the issue with it. I’m not sure, what the issue is.

    Take care!

    Thread Starter webhuntsupport

    (@webhuntsupport)

    Hello,

    Thanks for prompt support.

    Now i found another issue.

    The issue is :

    I import files using local import files (from theme folder)?

    But unfortunately i can’t importing demo-content.xml file on local sever.

    Now in my case widgets.json and customizer.dat file working properly but

    demo-content.xml not working.

    Please check ASAP.

    Thank You

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    what seems to be the problem with the content import? Do you get any errors?

    Take care!

    Thread Starter webhuntsupport

    (@webhuntsupport)

    Hello,

    No, it’s nothing says.

    Simply i click on “Import Demo Data” button AND it says

    Wasn’t this a great One Click Demo Import experience? Created and maintained by ProteusThemes.
    Click to Tweet!

    That’s it, all done!
    The demo import has finished. Please check your page and make sure that everything has imported correctly. If it did, you can deactivate the One Click Demo Import plugin, because it has done its job.

    But when i check into page and post menu, no pages and post and menu created.

    Thank You

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    I looked at your XML import file and it looks like it has 2 empty lines at the start of the file?

    If you remove those empty lines, does the import work?

    Take care!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘The customizer import file is not in a correct format.’ is closed to new replies.