[Plugin: 012 Ps Multi Languages] This is how i put language flags on my page
-
1) Copy the complete “flags” dir to your “img dir” or “images” dir in your theme.
2) follow the normal install procedure of the plugin: https://www.ads-software.com/extend/plugins/012-ps-multi-languages/installation/
3) Replace the following code in line 22:
/wp-content/plugins/012-ps-multi-languages/config/functions.php
$multilingual_snippet = $ps_multi_languages->ps_012_multilingual_list( $lang ); if ( !$echo ): return $multilingual_snippet; endif; $html .= '<ul class="snippet">'. "\n"; foreach ( $multilingual_snippet as $key => $val ){ $current = $val['current'] ? ' class="'.$val['current'].'" ' : ''; $html .= '<li'. $current .'>' . "\n"; $html .= '<a href="'.$val['url'].'">'.$val['name'].'</a>' . "\n"; $html .= '</li>' . "\n"; } $html .= '</ul>'. "\n"; echo $html; }
To:
$multilingual_snippet = $ps_multi_languages->ps_012_multilingual_list( $lang ); if ( !$echo ): return $multilingual_snippet; endif; $html .= '<ul class="snippet">'. "\n"; foreach ( $multilingual_snippet as $key => $val ){ $current = $val['current'] ? ' class="'.$val['current'].'" ' : ''; $flags_dir = get_bloginfo('template_directory'); //Put correct flag dir Url here: $flags_dir .= '/img/flags/'; $flag_icon = $flags_dir . $key . '.png'; $flag_icon = '<img src="'.$flag_icon.'" style="float:right;margin:2px;padding:1px;border:1px solid #021a40;background-color:#ff0>"'; $html .= '<a href="'.$val['url'].'">'.$flag_icon.'</a> '; } echo $html; }
4) Put the following code in your theme “header.php” between
<head>...</head>
where you want the flags to display:<?php if ( function_exists( 'ps_012_multilingual_list' ) ) $gs = ps_012_multilingual_list() ; ?>
That will do the trick.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: 012 Ps Multi Languages] This is how i put language flags on my page’ is closed to new replies.