New Landing How can we help? Themeforest Theme Support Joyn WPML problems (theme options not saving)

Viewing 15 posts - 1 through 15 (of 19 total)
  • Posted in: Joyn
  • #118166
    Matichek
    Member
    Post count: 6

    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

    #118172
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Is that the latest version?

    – Kyle

    #118173
    Matichek
    Member
    Post count: 6

    yes, this is the latest version of WPML

    #118490
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Please provide me with a link and login via private reply so I can check this for you

    – Kyle

    #118523
    Matichek
    Member
    Post count: 6

    Hi, 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);
    }

    #118529
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Ok great, thanks

    – Kyle

    #119015
    maartendc
    Member
    Post count: 17

    I have the same problem. I put the above code in the functions.php but that gives me a error.
    Any other help?

    #119019
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    @ maartendc can you provide your website url so we can see the error?
    -Rui

    #119193
    maartendc
    Member
    Post count: 17
    This reply has been marked as private.
    #119199
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    The 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

    #119224
    maartendc
    Member
    Post count: 17
    This reply has been marked as private.
    #119228
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779
    This reply has been marked as private.
    #119235
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    In 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

    #119254
    maartendc
    Member
    Post count: 17

    I need to put this in the function.php in stead of the other code (above)?

    #119275
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No, I did this in functions1.php
    Just can’t do it to all the functions you have inside.

    -Rui

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register