Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $smof_data;
- if ($smof_data['header_language_type'] == 'WPML language switcher' AND function_exists('icl_get_languages'))
- {
- $languages = icl_get_languages('skip_missing=0');
- if(1 < count($languages)){
- ?>
- <div class="w-lang layout_dropdown show_onclick has_title">
- <div class="w-lang-list">
- <?php foreach ($languages as $language) {
- if ($language['active'])
- {
- $current_language = $language;
- continue;
- }
- ?>
- <a class="w-lang-item lang_<?php echo $language['language_code'] ?>" href="<?php echo $language['url'] ?>">
- <span class="w-lang-item-icon"><img src="<?php echo $language['country_flag_url'] ?>" alt=""></span>
- <span class="w-lang-item-title"><?php echo ($language['native_name']) ?></span>
- </a>
- <?php } ?>
- </div>
- <div class="w-lang-current">
- <span class="w-lang-item">
- <span class="w-lang-item-icon"><img src="<?php echo $current_language['country_flag_url'] ?>" alt=""></span>
- <span class="w-lang-item-title"><?php echo ($current_language['native_name']) ?></span>
- </span>
- </div>
- </div>
- <style>
- .w-lang.has_title .w-lang-item-icon {
- display: inline-block;
- }
- .w-lang-item-icon {
- height: 22px;
- margin-right: 5px;
- }
- .w-lang-current .w-lang-item-icon {
- height: 26px;
- }
- </style>
- <?php //print_r($current_language);
- }
- }
- elseif ($smof_data['header_language_type'] == 'Your own links')
- {
- ?>
- <div class="w-lang layout_dropdown show_onclick has_title">
- <div class="w-lang-list">
- <?php for ($i = 2; $i <= $smof_data['header_language_amount']; $i++) {
- ?>
- <a class="w-lang-item lang_en" href="<?php echo (substr($smof_data['header_language_'.$i.'_url'], 0, 4) == 'http')?$smof_data['header_language_'.$i.'_url']:'//'.$smof_data['header_language_'.$i.'_url']; ?>">
- <span class="w-lang-item-icon"></span>
- <span class="w-lang-item-title"><?php echo $smof_data['header_language_'.$i.'_name'] ?></span>
- </a>
- <?php } ?>
- </div>
- <div class="w-lang-current">
- <span class="w-lang-item">
- <span class="w-lang-item-icon"></span>
- <span class="w-lang-item-title"><?php echo $smof_data['header_language_1_name'] ?></span>
- </span>
- </div>
- </div>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment