
PostmagThemes One click Demo Import for WordPress Site
v1.2.2postmagthemes · 2019年10月26日 上架
Import a theme's demo content, widgets and customizer settings in one click. Works with PostmagThemes themes and themes from other authors.
- 正在使用
- 1,000+
- 评分
- 暂无
- 累计下载
- 3.1 万
- 最近更新
- 2026年11月24日
贡献者
截图
PostmagThemes Demo Import sets up your site to look like the theme demo in a single click. Instead of creating posts, pages, menus and widgets by hand, activate the plugin, go to Appearance > Import Demo Data, and import. It works the same way as One Click Demo Import (OCDI).
It is built for PostmagThemes themes, but it also works with any theme that provides standard demo files.
The main advantage of this plugin is that theme developers can register their demo import files directly in their themes. Users then set up their website by simply clicking the Import button on the Import Demo Data page, just like with normal ocdi for wordpress theme demo importer.
Check out the demo video of our ocdi.
Features
- One-click import for supported PostmagThemes themes, with a preview of each available demo
- Works with any theme – upload the content (.xml), widgets (.wie) and customizer (.dat) files from your theme author
- Imports everything – posts, pages, media, menus, widgets and customizer settings
- Choose the post author – assign imported posts to any user on your site
- Safe uploads – files are checked for the correct type before they are saved to the server
- Theme developer friendly – register your theme’s demos with a single filter
- Translation ready
Supported PostmagThemes themes
Context Blog, Context Blog Pro, Blink, Ink, NewsMag and other PostmagThemes themes that support demo import.
How to import a demo
With a PostmagThemes theme
- Activate a PostmagThemes theme that supports demo import, such as Context Blog.
- Go to Appearance > Import Demo Data. You will see a preview of the theme’s demo.
- Click Import and wait for it to finish.
With a theme from another author
- Download the three demo files from the theme author’s website: content (.xml), widgets (.wie) and customizer settings (.dat).
- Go to Appearance > Import Demo Data. Because the active theme is not a PostmagThemes theme, you will see three upload fields instead of a demo preview.
- Upload each file to its matching field, then click Import.
Are you a theme developer?
Integrate PostmagThemes Demo Import into your theme and make website setup easier for your users. It takes just a few minutes.
Step 1: Register your demo files
Add the following code to your theme’s functions.php. Add it at the top level of the file, not inside your own after_setup_theme callback, otherwise the demo may not appear. Replace theme-text-domain with your theme’s text domain.
add_filter( 'pt-pmdi/import_files', function ( $import_files ) {
$import_files[] = array(
'import_file_name' => esc_html__( 'My Theme Demo name', 'theme-text-domain' ),
'categories' => array( esc_html__( 'Blog', 'theme-text-domain' ) ),
'import_file_url' => esc_url( 'https://example.com/demo/content.xml' ),
'import_widget_file_url' => esc_url( 'https://example.com/demo/widgets.wie' ),
'import_customizer_file_url' => esc_url( 'https://example.com/demo/customizer.dat' ),
'import_preview_image_url' => esc_url( 'https://example.com/demo/screenshot.png' ),
'preview_url' => esc_url( 'https://example.com/demo/' ),
'import_notice' => esc_html__( 'Optional note shown before import.', 'theme-text-domain' ),
);
return $import_files;
} );
Step 2: Recommend the plugin to your users
Add the following code to your theme’s functions.php to show your users a notice with a link to install PostmagThemes Demo Import. Replace the your_theme_ prefix and the theme-text-domain text domain with your own.
function your_theme_demo_import_notice() {
// Hide if the plugin is already active or the user can't install plugins.
if ( class_exists( 'PMDI\OneClickDemoImport' ) || ! current_user_can( 'install_plugins' ) ) {
return;
}
$url = admin_url( 'plugin-install.php?s=postmagthemes-demo-import&tab=search&type=term' );
?>
<div class="notice notice-info is-dismissible">
<p>
<?php esc_html_e( 'Want your site to look like the theme demo? Install the free PostmagThemes Demo Import plugin to import the demo content in one click.', 'theme-text-domain' ); ?>
<a href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'Get PostmagThemes Demo Import', 'theme-text-domain' ); ?></a>
</p>
</div>
<?php
}
add_action( 'admin_notices', 'your_theme_demo_import_notice' );
Step 3 (optional): Hide the PostmagThemes showcase
The Import Demo Data page shows PostmagThemes’ free themes and plugins. If you prefer not to show them to your users, add this to your theme’s functions.php:
add_filter( 'pt-pmdi/show_wporg_showcase', '__return_false' );
Are you a theme user?
Ask your theme developer to support this plugin. Let them know how easy it makes setting up a site with their theme’s demo.
Note: By default, demo content is imported under the currently logged-in WordPress user. Before importing, you can choose a different existing user to be the author of the imported posts.
Contribute
PostmagThemes Demo Import is open source and developed on GitHub. Bug reports, feature ideas and pull requests are welcome:
For general help, please use the support forum.
Credits
Based on One Click Demo Import.
Image Resources
All plugin images (banners, icons and screenshots) are self-created and licensed under Creative Commons Zero (CC0).


