Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Joyn › WPML problems (theme options not saving)
New Landing › How can we help? › Themeforest Theme Support › Joyn › WPML problems (theme options not saving)
- This topic has 18 replies, 5 voices, and was last updated 9 years by Swift Ideas – Ed.
-
Posted in: Joyn
-
October 7, 2014 at 3:40 pm #118166
Hello,
when using WPML 3.1.7.2 version, you can not save anything in the theme options … options does save when you disable WPML …
Thank you
October 7, 2014 at 3:47 pm #118172Hi
Is that the latest version?
– Kyle
October 7, 2014 at 3:49 pm #118173yes, this is the latest version of WPML
October 8, 2014 at 11:49 am #118490Please provide me with a link and login via private reply so I can check this for you
– Kyle
October 8, 2014 at 12:42 pm #118523Hi, our developer managed to find a fix. Problem is in WPML string translation, that has action on “update_option”. When you have backend in custom language, options won’t save. Current fix we put into functions.php is:
if (!function_exists(‘sf_check_theme_options_update’)) {
function sf_check_theme_options_update() {
if(isset($_REQUEST[‘option_page’]) && ‘sf_joyn_options_group’ == $_REQUEST[‘option_page’]){
remove_action(‘update_option’, ‘update_option_to_translate_string’, 5);
}
}
add_action(‘init’, ‘sf_check_theme_options_update’, 0);
}October 8, 2014 at 12:52 pm #118529Ok great, thanks
– Kyle
October 9, 2014 at 7:17 pm #119015I have the same problem. I put the above code in the functions.php but that gives me a error.
Any other help?October 9, 2014 at 7:58 pm #119019@ maartendc can you provide your website url so we can see the error?
-RuiOctober 10, 2014 at 10:39 am #119193This reply has been marked as private.October 10, 2014 at 10:55 am #119199The user profile should be admin, and will also need that the funcions.php exist already there so I can changed it because I can’t create new files.
Thanks.-Rui
October 10, 2014 at 12:34 pm #119224This reply has been marked as private.October 10, 2014 at 12:39 pm #119228This reply has been marked as private.October 10, 2014 at 1:01 pm #119235In this case you can’t declare the functions with the same name.
You should create them with a different name, remove the original function that was hooked, and hook the new function.Like in the example below.
function sf_child_enqueue_styles() { $options = get_option('sf_neighborhood_options'); $enable_responsive = $options['enable_responsive']; wp_register_style('bootstrap', SF_LOCAL_PATH . '/css/bootstrap.min.css', array(), NULL, 'screen'); wp_register_style('bootstrap-responsive', SF_LOCAL_PATH . '/css/bootstrap-responsive.min.css', array(), NULL, 'screen'); wp_register_style('fontawesome-css', SF_LOCAL_PATH . '/css/font-awesome.min.css', array(), NULL, 'screen'); wp_register_style('main-css', get_stylesheet_directory_uri() . '/style.css', array(), NULL, 'screen'); wp_register_style('responsive-css', SF_LOCAL_PATH . '/css/responsive.css', array(), NULL, 'screen'); //wp_register_style('sf-rtl', SF_LOCAL_PATH . '/rtl.css', array(), NULL, 'all'); wp_enqueue_style('bootstrap'); wp_enqueue_style('bootstrap-responsive'); wp_enqueue_style('fontawesome-css'); wp_enqueue_style('main-css'); if ($enable_responsive) { wp_enqueue_style('responsive-css'); } //wp_enqueue_style('sf-rtl'); } remove_action('wp_enqueue_scripts', 'sf_enqueue_styles'); add_action('wp_enqueue_scripts', 'sf_child_enqueue_styles', 99);
-Rui
October 10, 2014 at 1:48 pm #119254I need to put this in the function.php in stead of the other code (above)?
October 10, 2014 at 2:31 pm #119275No, I did this in functions1.php
Just can’t do it to all the functions you have inside.-Rui
-
Posted in: Joyn
You must be logged in and have valid license to reply to this topic.