enabled_languages, WPGlobus::Config()->language ); foreach ( $enabled_languages as $language ): $url = null; $is_current = true; if ( $language != WPGlobus::Config()->language ) { $url = WPGlobus_Utils::localize_current_url( $language ); $is_current = false; } $flag = ''; $link = $flag . ' ' . WPGlobus::Config()->en_language_name[$language] . '   '; printf( '%s', ( empty( $url ) ? '' : 'href="' . esc_url( $url ) . '"' ), ( $is_current ? 'class="wpglobus-current-language"' : '' ), $link ); endforeach; ?>
array( 'src' => 'https://wetag.io/wp-content/plugins/language-icons-flags-switcher/img/english.png', 'alt' => 'English', 'title' => 'English' ), 'vi' => array( 'src' => 'https://wetag.io/wp-content/plugins/language-icons-flags-switcher/img/Vietnam.png', 'alt' => 'Vietnam', 'title' => 'Vietnam' ) ); echo '
'; foreach( WPGlobus::Config()->enabled_languages as $language ) { if ( $language == WPGlobus::Config()->language ) { continue; } echo ''; echo ''.$wpglobus_language_image[$language]['alt'].''; echo ''; } echo '
'; endif; /** * WPGlobus language switcher. * Example 3: If you need to hide extra languages from the switcher on the category or tag page. * * You can add this code to your active theme's `functions.php` file. * Please note the information about the child theme * https://developer.wordpress.org/themes/advanced-topics/child-themes/ */ if ( class_exists( 'WPGlobus' ) ): add_filter( 'wpglobus_extra_languages', 'filter__extra_languages', 5, 2 ); function filter__extra_languages( $extra_languages, $current_language ) { if ( is_tag() || is_category() ) { return array(); } return $extra_languages; } endif; /** * WPGlobus language switcher. * Example 4: You can remove the language switcher from a particular page at all. * @since WPGlobus v.2.10.2 * * You can add this code to your active theme's `functions.php` file. * Please note the information about the child theme * https://developer.wordpress.org/themes/advanced-topics/child-themes/ */ if ( class_exists( 'WPGlobus' ) ): add_filter( 'wpglobus_disable_switcher', 'filter__disable_switcher', 5, 3 ); function filter__disable_switcher( $disable_switcher, $current_language, $nav_menu ) { if ( is_tag() ) { return true; } return $disable_switcher; } endif; # --- EOF