How can I override file featured-image-first.php of Avada theme [closed]

Child themes let you override templates loaded via WordPress’ template loading mechanism, e.g. get_template_part or the main theme templates such as index.php and single.php. But they can’t be used to replace arbitrary PHP files or assets. If a theme loads a template file using require or include, WordPress cannot intercept this and replace it with … Read more

Remove the widgets tab from theme customizer

you can create function for theme customizer with all the settings you need: to remove “widgets” we will need to remove the “widgets” panel. put this code in function.php function your_customizer( $wp_customize ) { $wp_customize->remove_panel( ‘widgets’ ); } add_action( ‘customize_register’, ‘your_customizer’ ); or if you have your own function just add: $wp_customize->remove_panel( ‘widgets’ );

Hide Theme options and Customize Admin menu

Direct answer: add_action( ‘admin_menu’, function() { global $current_user; $current_user = wp_get_current_user(); $user_name = $current_user->user_login; //check condition for the user means show menu for this user if(is_admin() && $user_name != ‘USERNAME’) { //We need this because the submenu’s link (key from the array too) will always be generated with the current SERVER_URI in mind. $customizer_url = … Read more

Using jQuery to retrieve customizer value

Use that JQuery code from your question in customizer preview for real time update. Your transport should be set to ‘postMessage’. In your website you can add body class in function.php: function theme_prefix_body_class( $classes ) { if ( get_theme_mod(‘header_fixed’, 0 ) == true ) { $classes[] = ‘fixed-header’; } return $classes; } add_filter( ‘body_class’, ‘theme_prefix_body_class’ … Read more

How can I use a $wp_customize to edit my homepage image slider?

Currently not. You cannot set an array of n fields in you WP_Customize_Manager::add_control method in the customize_register action hook. The class creating the controls is WP_Customize_Control and does only accept the following types: checkbox radio select textarea dropdown-pages and per default any valid input type You will need an options page to edit/create your gallery … Read more

Change setting name in Customizer and keep the data

Personally I think keeping your mods in an array is a nice solution, but transferring them shouldn’t be too difficult. Just loop through the array like this: $all_mods = get_theme_mod(‘thefunk_theme_options’); // retrieve array foreach ($all_mods as $key -> $value) { if (!empty($value)) set_theme_mod ($key,$value); // set array element as separate mod } Since you have … Read more

Customizer, change preview url when a control changes

Gonna have a go… say you have a theme option themeoption[id]… instead of setting transport refresh, set it to postMessage instead, and then add this code to create a callback that first gets the page URL via AJAX then sends that back to the previewUrl as you mentioned before refreshing… add_action(‘customize_preview_init,’preview_override_loader’); function preview_override_loader() { add_action(‘wp_footer’,’preview_override_script’); … Read more