Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1051853

    Hi awesome Enfold team!

    Will copy paste to save time chat with WPML:
    https://wpml.org/forums/topic/enfold-disable-remove-language-switcher-flag-leave-just-text/

    /////////////
    I am trying to: Have no flag images in my language switcher, currently it fetches an empty image, could not find the place in code where to remove images from language switcher and just leave language text (ET, EN, RU, FI)
    Need to remove emtpy flag images.

    Link to a page where the issue can be seen: https://truman.ee – but currently the flags are display: none; please check screenshot

    I expected to see: I expect to see just EN, FI, RU, ET in the language switcher and have absolutely no language switcher flag images.

    Instead, I got: Instead I got EN, FI, RU, ET but also with an empty image look.
    /////////

    #1051856

    Screenshot:
    https://ibb.co/zQSpZxY

    Currently I’ve via custom css set display: none so clients don’t see it.

    #1052776

    Hi,

    Will try to simplify my request, it’s actually very straightforward.

    Screenshot: https://ibb.co/8j86Wcp

    1. In the screenshot you see in HTML it’s fetching an image RU.png
    2. I need to stop the theme from fetching ANY images just leave the ET / RU ….
    3. Where do I do that please help :)

    KIrill

    #1053060

    Hi KIrill,

    You need to copy this function to your functions.php to your child theme from the file /enfold/config-wpml/config.php
    Image 2019-01-12 at 13.51.48.png

    and remove the code that adds an image to the menu item.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1053234

    Hi,

    1. I cannot copy code from image file, please post code as text.
    2. Can you please point me what code block add image, I can’t find it?
    3. Or can somebody log in and do that quickly?

    Kirill

    #1053670

    Hi kirillko,

    Here is the code you can put in your funtions.php

    
    /*
    	* styleswitcher for the avia framework
    	*/
    	if(!function_exists('avia_wpml_language_switch'))
    	{
    		add_action( 'avia_meta_header', 'avia_wpml_language_switch', 10);
    		add_action( 'ava_main_header_sidebar', 'avia_wpml_language_switch', 10);
    
    		function avia_wpml_language_switch()
    		{
    			global $sitepress, $avia_config;
                
                if(empty($avia_config['wpml_language_menu_position'])) $avia_config['wpml_language_menu_position'] = apply_filters('avf_wpml_language_switcher_position', 'sub_menu');
                if($avia_config['wpml_language_menu_position'] != 'sub_menu') return;
    
    			// icl_get_languages deprecated since 3.2
    			$languages = function_exists( 'wpml_get_active_languages_filter' ) ? wpml_get_active_languages_filter( '', 'skip_missing=0&orderby=custom' ) : icl_get_languages( 'skip_missing=0&orderby=custom' );
    			$output = "";
    
    			if(is_array($languages))
    			{
    				$output .= "<ul class='avia_wpml_language_switch avia_wpml_language_switch_extra'>";
    
    				foreach($languages as $lang)
    				{
    					$currentlang = (ICL_LANGUAGE_CODE == $lang['language_code']) ? 'avia_current_lang' : '';
    
    					if(!avia_is_overview() && (is_home() || is_front_page())) $lang['url'] = $sitepress->language_url($lang['language_code']);
    					         
    					$output .= "<li class='language_".$lang['language_code']." $currentlang'><a href='".$lang['url']."'>";
    					$output .= "	<span class='language_native'>".$lang['native_name']."</span>";
    					$output .= "	<span class='language_translated'>".$lang['translated_name']."</span>";
    					$output .= "	<span class='language_code'>".$lang['language_code']."</span>";
    					$output .= "</a></li>";
    				}
    
    				$output .= "</ul>";
    			}
    
    			echo $output;
    		}
    	}
    
    

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1053680

    Hi,

    1. I copied this code to functions.php and nothing happened.
    2. Any other easy option to remove the flag image from code?
    3. Feels we are running in circles ;( let’s solve it and forget about it.

    Kirill

    #1053818

    Hi Kirill,

    You put it in the wrong place, I moved it. Please enable the switcher and check.

    And flush the cache of course.

    Best regards,
    Victoria

    #1053825

    Hi Victoria,

    Super thank you, feels we are almost there ! :)

    Now I can see that in HTML the language switcher is there, however both image and title text disappeared.

    We need to return the ET/RU/FI/EN part.

    Kirill

    #1054195

    Hi!

    Here is the code you can put in Enfold > General Styling > Quick Css,  if it does not work, put into themes/enfold/css/custom.css

    
    .avia_wpml_language_switch li span.language_translated {
    	display:block;
    }
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1054219

    Hi Victoria,

    Bravo, exactly as I wanted!

    Enfold as usual 5 stars (already posted reviews everywhere I could) :)

    Thanks!
    Kirill

    #1054318

    Hi Kirill,

    Glad we could help!

    Thank you for using Enfold :)

    Best regards,
    Victoria

    • This reply was modified 5 years, 11 months ago by Victoria.
    #1105490

    HI,
    I followed the instructions above, but I still can’t see the change of language in the top bar, I see it in the html code.
    Moreover, now the language change is on the left, I would like it right next to the social networks.
    Thank you for your support.

    #1106089

    Hi famarinu,

    Please start a separate thread, describe your issue there and give us a link to your website to avoid confusion.

    Best regards,
    Victoria

    #1106098
    #1106418

    Hi famarinu,

    Thank you. I am closing this one as we continue our discussion in the new thread.

    Best regards,
    Victoria

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Enfold Disable / Remove language switcher flag, leave just text.’ is closed to new replies.