Skip Navigation

Open

Reported for: WPML Multilingual CMS 4.4.10

Topic Tags: Language Switcher

Overview of the issue

If you add a language switcher in a widget area, you will notice that the Hover color options are not displayed in front-end.

Workaround

To fix this:

  • Please, before proceeding make a full backup of your site.
  • Open your /wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-inline-styles.php, LINE 148.
  • Replace this:
    if ( $slot->get( 'font_other_hover' ) || $slot->get( 'background_other_hover' ) ) {
        	$css .= "$wrapper_class a:hover,$wrapper_class a:focus {";
        	$css .= $slot->get( 'font_other_hover' ) ? "color:{$slot->get( 'font_other_hover' )};" : '';
        	$css .= $slot->get( 'background_other_hover' ) ? "background-color:{$slot->get( 'background_other_hover' )};" : '';
        	$css .= '}';
    }
    
  • With:
    if ( $slot->get( 'font_other_hover' ) || $slot->get( 'background_other_hover' ) ) {
    	$css .= "$wrapper_class .wpml-ls-item a:hover,$wrapper_class .wpml-ls-item a:focus {";
    	$css .= $slot->get( 'font_other_hover' ) ? "color:{$slot->get( 'font_other_hover' )};" : '';
    	$css .= $slot->get( 'background_other_hover' ) ? "background-color:{$slot->get( 'background_other_hover' )};" : '';
    	$css .= '}';
    }
    
  • Then look for line 141.
  • Replace this:
    if ( $slot->get( 'font_other_normal' ) || $slot->get( 'background_other_normal' ) ) {
    			$css .= "$wrapper_class>a:link {";
    			$css .= $slot->get( 'font_other_normal' ) ? "color:{$slot->get( 'font_other_normal' )};" : '';
    			$css .= $slot->get( 'background_other_normal' ) ? "background-color:{$slot->get( 'background_other_normal' )};" : '';
    			$css .= '}';
    }
    
  • With:
    if ( $slot->get( 'font_other_normal' ) || $slot->get( 'background_other_normal' ) ) {
    			$css .= "$wrapper_class .wpml-ls-item a:link {";
    			$css .= $slot->get( 'font_other_normal' ) ? "color:{$slot->get( 'font_other_normal' )};" : '';
    			$css .= $slot->get( 'background_other_normal' ) ? "background-color:{$slot->get( 'background_other_normal' )};" : '';
    			$css .= '}';
    }
    

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>