banner



Where Are The Xml And Dat Files Wordpress.org Template

Quickly import theme live demo content, widgets and settings. This provides a basic layout to build your website and speed up the development process.

This plugin will create a page in Advent > Import Demo Content.

If the theme you are using does non have whatever predefined import files, then you will exist presented with iii file upload inputs.

Offset one is required and you will have to upload a demo content XML file, for the actual demo import.

The second one is optional and volition ask y'all for a WIE or JSON file for widgets import. You lot create that file using the Widget Importer & Exporter plugin.

The 3rd i is too optional and will import the customizer settings, select the DAT file which you lot tin can generate from Customizer Export/Import plugin (the customizer settings will be imported simply if the export file was created from the same theme).

This plugin is based off the 'One Click Demo Import' plugin by @capuderg and @cyman, https://github.com/proteusthemes/one-click-demo-import.

As well equally the improved WP Import two.0 plugin by @humanmade, https://github.com/humanmade/WordPress-Importer.

License

Theme Demo Import uses 'Ane Click Demo Import' plugin script
https://github.com/proteusthemes/one-click-demo-import
(C) 2016 ProteusThemes.com
Licensed under the GNU General Public License v2.0,
http://world wide web.gnu.org/licenses/gpl-2.0.html

Theme Demo Import uses 'WordPress Importer' plugin script
https://github.com/humanmade/WordPress-Importer
(C) 2016 @humanmade
Licensed under the GNU General Public License v2.0,
http://www.gnu.org/licenses/gpl-2.0.html

Copyright

Theme Demo Import, Copyright 2016 Ishmael 'Hans' Desjarlais

Theme Demo Import is distributed under the terms of the GNU GPL

This plan is free software; you tin can redistribute information technology and/or modify
it under the terms of the GNU Full general Public License as published by
the Costless Software Foundation; either version ii of the License, or
(at your selection) whatsoever later on version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without fifty-fifty the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more than details.

You should take received a copy of the GNU General Public License forth
with this programme; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Flooring, Boston, MA 02110-1301 USA.

From your WordPress dashboard

  1. Visit 'Plugins > Add together New',
  2. Search for 'Theme Demo Import' and install the plugin.
  3. Activate 'Theme Demo Import' from your Plugins page.

One time the plugin is activated you will discover the actual import page in Advent -> Import Demo Content.

I accept activated the plugin. Where is the "Import Demo Content" page?

You volition detect the import page in wp-admin -> Advent -> Import Demo Content.

Where are the demo import files and the log files saved?

The files used in the demo import will be saved to the default WordPress uploads directory. An example of that directory would be: ../wp-content/uploads/2016/03/.

The log file will besides be registered in the wp-admin -> Media section, so you tin admission it easily.

How to predefine demo imports?

This question is for theme authors. To predefine demo imports, you lot just take to add the following code structure, with your own values to your theme (using the theme-demo-import/import_files filter):

                function TDI_import_files() {     render array(         array(             'import_file_name'           => 'Demo Import 1',             'import_file_url'            => 'http://www.your_domain.com/tdi/demo-content.xml',             'import_widget_file_url'     => 'http://world wide web.your_domain.com/tdi/widgets.json',             'import_customizer_file_url' => 'http://world wide web.your_domain.com/tdi/customizer.dat',             'import_preview_image_url'   => 'http://www.your_domain.com/tdi/preview_import_image1.jpg',             'import_notice'              => __( 'After y'all import this demo, you will have to setup the slider separately.', 'your-textdomain' ),         ),         array(             'import_file_name'           => 'Demo Import 2',             'import_file_url'            => 'http://www.your_domain.com/tdi/demo-content2.xml',             'import_widget_file_url'     => 'http://www.your_domain.com/tdi/widgets2.json',             'import_customizer_file_url' => 'http://world wide web.your_domain.com/tdi/customizer2.dat',             'import_preview_image_url'   => 'http://www.your_domain.com/tdi/preview_import_image2.jpg',             'import_notice'              => __( 'A special note for this import.', 'your-textdomain' ),         ),     ); } add_filter( 'theme-demo-import/import_files', 'TDI_import_files' );                              

You can ready content import, widgets, and customizer import files. You can also define a preview image, which will exist used only when multiple demo imports are defined, and so that the user will see the divergence between imports.

How to automatically assign "Front page", "Posts page" and carte du jour locations after the importer is done?

Yous tin practice that, with the theme-demo-import/after_import action hook. The code would wait something like this:

                role TDI_after_import_setup() {     // Assign menus to their locations.     $main_menu = get_term_by( 'name', 'Top Menu', 'nav_menu' );      set_theme_mod( 'nav_menu_locations', array(             'master-menu' => $main_menu->term_id,         )     );      // Assign front page and posts page (web log folio).     $front_page_id = get_page_by_title( 'Domicile' );     $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 );  } add_action( 'theme-demo-import/after_import', 'TDI_after_import_setup' );                              

What nigh using local import files (from theme folder)?

Yous accept to use the same filter every bit in higher up example, but with a slightly dissimilar array keys: local_*. The values accept to be absolute paths (not URLs) to your import files. To use local import files, that reside in your theme binder, please use the beneath code. Note: make sure your import files are readable!

                function TDI_import_files() {     return array(         array(             'import_file_name'             => 'Demo Import ane',             'local_import_file'            => trailingslashit( get_template_directory() ) . 'tdi/demo-content.xml',             'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'tdi/widgets.json',             'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'tdi/customizer.dat',             'import_preview_image_url'     => 'http://www.your_domain.com/tdi/preview_import_image1.jpg',             'import_notice'                => __( 'After you import this demo, you will have to setup the slider separately.', 'your-textdomain' ),         ),         array(             'import_file_name'             => 'Demo Import 2',             'local_import_file'            => trailingslashit( get_template_directory() ) . 'tdi/demo-content2.xml',             'local_import_widget_file'     => trailingslashit( get_template_directory() ) . 'tdi/widgets2.json',             'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'tdi/customizer2.dat',             'import_preview_image_url'     => 'http://www.your_domain.com/tdi/preview_import_image2.jpg',             'import_notice'                => __( 'A special notation for this import.', 'your-textdomain' ),         ),     ); } add_filter( 'theme-demo-import/import_files', 'TDI_import_files' );                              

How to handle different "after import setups" depending on which predefined import was selected?

This question might be asked by a theme writer wanting to implement different after import setups for multiple predefined demo imports. Lets say we have predefined two demo imports with the following names: 'Demo Import 1' and 'Demo Import 2', the code for subsequently import setup would be (using the theme-demo-import/after_import filter):

                function TDI_after_import( $selected_import ) {     echo "This volition be displayed on all after imports!";      if ( 'Demo Import 1' === $selected_import['import_file_name'] ) {         echo "This will be displayed just on after import if user selects Demo Import one";          // Set logo in customizer         set_theme_mod( 'logo_img', get_template_directory_uri() . '/assets/images/logo1.png' );     }     elseif ( 'Demo Import 2' === $selected_import['import_file_name'] ) {         repeat "This will exist displayed merely on subsequently import if user selects Demo Import 2";          // Set logo in customizer         set_theme_mod( 'logo_img', get_template_directory_uri() . '/assets/images/logo2.png' );     } } add_action( 'theme-demo-import/after_import', 'TDI_after_import' );                              

Tin can I add some lawmaking before the widgets get imported?

Of course you tin can, employ the theme-demo-import/before_widgets_import action. You lot tin can as well target different predefined demo imports like in the example above. Hither is a simple case code of the theme-demo-import/before_widgets_import action:

                part TDI_before_widgets_import( $selected_import ) {     echo "Add your code here that will exist executed before the widgets go imported!"; } add_action( 'theme-demo-import/before_widgets_import', 'TDI_before_widgets_import' );                              

You lot tin can modify the plugin intro text by using the theme-demo-import/plugin_intro_text filter:

                function TDI_plugin_intro_text( $default_text ) {     $default_text .= '<div form="TDI__intro-text">This is a custom text added to this plugin intro text.</div>';      return $default_text; } add_filter( 'theme-demo-import/plugin_intro_text', 'TDI_plugin_intro_text' );                              

To add some text in a dissever "box", y'all should wrap your text in a div with a class of 'TDI__intro-text', like in the lawmaking case above.

How to disable generation of smaller images (thumbnails) during the content import

This will greatly better the time needed to import the content (images), but only the original sized images will exist imported. You can disable it with a filter, so but add this code to your theme function.php file:

                add_filter( 'theme-demo-import/regenerate_thumbnails_in_content_import', '__return_false' );                              

How to change the location, title and other parameters of the plugin page?

As a theme author y'all do not like the location of the "Import Demo Content" plugin page in Appearance -> Import Demo Content? You tin change that with the filter below. Apart from the location, you lot can likewise alter the championship or the folio/menu and some other parameters as well.

                function TDI_plugin_page_setup( $default_settings ) {     $default_settings['parent_slug'] = 'themes.php';     $default_settings['page_title']  = esc_html__( 'Theme Demo Import' , 'theme-demo-import' );     $default_settings['menu_title']  = esc_html__( 'Import Demo Content' , 'theme-demo-import' );     $default_settings['capability']  = 'import';     $default_settings['menu_slug']   = 'theme-demo-import';      render $default_settings; } add_filter( 'theme-demo-import/plugin_page_setup', 'TDI_plugin_page_setup' );                              

I can't activate the plugin, because of a fatal error, what tin I practice?

Update: In that location is now a admin error discover, stating that the minimal PHP version required for this plugin is 5.three.2.

You want to activate the plugin, but this mistake shows upwardly:

Plugin could not exist activated because it triggered a fatal error

This happens, because your hosting server is using a very quondam version of PHP. This plugin requires PHP version of at least 5.3.x, just we recommend version 5.six.x. Please contact your hosting company and ask them to update the PHP version for your site.

We've tested this plugin extensively and packaged it with our themes, information technology works flawlessly.

Read all 1 review

"Theme Demo Importer" is open source software. The post-obit people have contributed to this plugin.

Contributors

  • themely

**ane.0.5 – March 29, 2019 **

  • Removed extra $ on line 72 of class-tdi-helpers.php which was triggering a PHP 7.0+ error

1.0.ii – x/25/2016

  • Removed dependencies on 3rd party plugin
  • Renamed classes for HM files
  • Added license and copyright data to readme.txt file
  • Updated the plugin clarification

1.0.1 – 10/15/2016

  • Updated text strings
  • Updated styles (UI)
  • Removed unnecessary code

1.0.0 – 10/ten/2016

  • INITIAL RELEASE

Where Are The Xml And Dat Files Wordpress.org Template,

Source: https://wordpress.org/plugins/theme-demo-import/

Posted by: collieradaughicell.blogspot.com

0 Response to "Where Are The Xml And Dat Files Wordpress.org Template"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel