Issue with changing default settings during the theme’s activation (ver 3.x)
-
Hi guys,
we have following issue with Elementor 3.x:
for our WordPress theme we need to change a couple of default Elementor’s settings during the theme’s activation. In Elementor 2.9.14 we have used following code for this:
function my_theme_activate_elementor_settings() { $cpt = get_option('elementor_cpt_support') ? get_option('elementor_cpt_support') : array(); $cpt = array_merge($cpt, array('post', 'page', 'my_title', 'my_footer', 'product')); update_option('elementor_cpt_support', $cpt); update_option('elementor_disable_color_schemes', 'yes'); update_option('elementor_disable_typography_schemes', 'yes'); update_option('elementor_container_width', '1170'); update_option('elementor_stretched_section_container', '#main'); update_option('elementor_page_title_selector', '.page-title-block h1'); update_option('elementor_global_image_lightbox', 'no'); }
However, starting from Elementor 3.x you have moved the settings container_width, stretched_section_container, page_title_selector, global_image_lightbox from wp options to meta field _elementor_page_settings of Default Kit template.
And here is our question: how we can change this settings during the theme activation now?
Scenario 1: the theme is being installed AFTER Elementor’s installation (Default Kit template is already available during the theme’s activation).
Scenario 2: the theme has been installed BEFORE Elementor’s installation (No Default Kit template available during the theme’s acativation).
- The topic ‘Issue with changing default settings during the theme’s activation (ver 3.x)’ is closed to new replies.