Want more features on Pastebin? Sign Up, it's FREE!
Guest

WordPress 012 Ps Multi Languages Flags

By: a guest on Oct 1st, 2012  |  syntax: PHP  |  size: 0.58 KB  |  views: 98  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.         $flags_dir = get_bloginfo('template_directory');
  3.         $flags_dir .= '/images/flags/';
  4.         foreach(array_reverse($gs, true) as $key=>$val){
  5.                 $flag_icon = $flags_dir . $key . '.png';
  6.                 if ( url_exists( $flag_icon )):
  7.                         if ($val['current']) {
  8.                                 $flag_icon = '<img src="'.$flag_icon.'" style="float:right;margin:2px;padding:1px;border:1px solid #021a40;background-color:#ff0>"';
  9.                         }
  10.                         else
  11.                         {
  12.                                 $flag_icon = '<img src="'.$flag_icon.'" style="float:right;margin:2px">';
  13.                         }
  14.                 endif;
  15.                 $html .= '<a href="'.$val['url'].'">'.$flag_icon.'</a>&nbsp';
  16.         }
  17.  
  18.         echo $html;
  19. ?>
clone this paste RAW Paste Data