- This topic has 4 replies, 3 voices, and was last updated 3 years, 2 months ago by
Fernando.
-
AuthorPosts
-
February 11, 2023 at 12:30 am #2529174
Anil
Hi
I have configured this site with GPP using
5 elements
custom css in Simple CSS
6 active snippets in Code Snippets
and GP Customisation.I like to replicate this on more than 20 domains.
Replicating this way is time consuming, can you please guide to build one child theme with all above settings,
and uploading and activating child theme would be easier task …Please guide…
February 11, 2023 at 6:33 am #2529377David
StaffCustomer SupportHi Anil,
moving Simple CSS ( styles.css ) and Code Snippets ( functions.php ) into a child theme is simple.
Moving Customizer Settings and Elements is not.
Customizer settings are saved in an options table, so that would require a separate integration.
And Elements are a Post Type so those would need importing into the site as per any other post type.The simplest method would be to use a plugin such as this one:
https://wordpress.org/plugins/duplicator/
Then you can just create an export package, and import it into your other domains.
February 11, 2023 at 8:36 pm #2529979Anil
Thanks David for guidance, i’ll try this…
February 12, 2023 at 3:45 am #2530159Anil
Hi David, I tried duplicator, but not useful to just exporting needed stuff.
1. Simple css can be copied and paste into child theme css — possible.
2. Code snippets into functions.php — possible.3. Customizer settings:
a. 1st option : export and then import into another site
b. 2nd option : Customizer settings are saved in an options table — can you please further guide…4. Elements: (GPP’s unique featue & proprietorship)
a. 1st option : Can wp-admin/export.php and import be of any help here…
b. 2nd option : exporting from mysql-table needed rows and then importing them.
c. 3rd option : converting elements into php code like in Code snippets or in functions.php — can you please further guide… (SOLVED)Warm regards.
P.S. : Can there be any possibility to make a package like importing a site from site library ? Actually it is doing all these things…
Well, after posting this, I tried and converted elements into php codes as they were some hooks… (except generateblocks)
Now, only issue is to get Customizer settings in child theme, please advise…
I think this is to be managed with re-declaring defaults…. or serialising and storing in options table…
February 12, 2023 at 5:43 pm #2530849Fernando Customer Support
Hi Anil,
3. What David is saying is that in comparison to CSS and PHP which can be stored in the files of a Child Theme, customizer settings are stored in the Database. This is why David suggested using a plugin for ease of “export and import”. You could also try using a different plugin.
Your first option would do as well but you would need to import it manually to all 20 sites one by one. Reference: https://docs.generatepress.com/article/import-export-overview/
4. In the same way, Element data are also stored in the database. You would need to export and import them as well.
Package-wise, you can just use an import-export plugin. One commonly used is All-in-One WP Migration: https://wordpress.org/plugins/all-in-one-wp-migration/
This should work in the same way that Site Library template importation works.
You could also try using PHP to alter some customizer defaults.
References:
https://docs.generatepress.com/article/option_generate_settings/
https://docs.generatepress.com/article/option_generate_secondary_nav_settings/
https://docs.generatepress.com/article/option_generate_menu_plus_settings/
https://docs.generatepress.com/article/option_generate_blog_settings/
https://docs.generatepress.com/article/option_generate_woocommerce_settings/What we would recommend is using a migration tool instead.
-
AuthorPosts
- You must be logged in to reply to this topic.