-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for WPML language switcher
- Loading branch information
Showing
10 changed files
with
111 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
if (defined('ICL_LANGUAGE_CODE')) { | ||
define('ICL_DONT_LOAD_NAVIGATION_CSS', true); | ||
define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true); | ||
define('ICL_DONT_LOAD_LANGUAGES_JS', true); | ||
|
||
|
||
function lang_switch_link() { | ||
$arr = icl_get_languages(); | ||
$cur = ICL_LANGUAGE_CODE; | ||
|
||
if ($cur == "de" && array_key_exists('en', $arr)) { | ||
$url = $arr["en"]["url"]; | ||
} elseif (array_key_exists('de', $arr)) { | ||
$url = $arr["de"]["url"]; | ||
} else { | ||
$url = "#"; | ||
} | ||
|
||
?> | ||
<a class="lang-link" href="<?php echo $url ?>" title="<?php _e('View translated page', 'bonestheme') ?>"></a> | ||
<?php | ||
} | ||
|
||
} else { | ||
function lang_switch_link() {} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!doctype html> | ||
|
||
<!--[if lt IE 7]><html <?php language_attributes(); ?> class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | ||
<!--[if (IE 7)&!(IEMobile)]><html <?php language_attributes(); ?> class="no-js lt-ie9 lt-ie8"><![endif]--> | ||
<!--[if (IE 8)&!(IEMobile)]><html <?php language_attributes(); ?> class="no-js lt-ie9"><![endif]--> | ||
<!--[if gt IE 8]><!--> <html <?php language_attributes(); ?> class="no-js"><!--<![endif]--> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<!-- Google Chrome Frame for IE --> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
|
||
<title><?php wp_title(''); ?></title> | ||
|
||
<!-- mobile meta (hooray!) --> | ||
<meta name="HandheldFriendly" content="True"> | ||
<meta name="MobileOptimized" content="320"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
|
||
<!-- icons & favicons (for more: http://www.jonathantneal.com/blog/understand-the-favicon/) --> | ||
<link rel="apple-touch-icon" href="<?php echo get_stylesheet_directory_uri(); ?>/library/images/apple-icon-touch.png"> | ||
<link rel="icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.png"> | ||
<!--[if IE]> | ||
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico"> | ||
<![endif]--> | ||
<!-- or, set /favicon.ico for IE10 win --> | ||
<meta name="msapplication-TileColor" content="#094164"> | ||
<meta name="msapplication-TileImage" content="<?php echo get_stylesheet_directory_uri(); ?>/library/images/win8-tile-icon.png"> | ||
|
||
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"> | ||
|
||
<!-- wordpress head functions --> | ||
<?php wp_head(); ?> | ||
<!-- end of wordpress head --> | ||
|
||
<!-- drop Google Analytics Here --> | ||
<!-- end analytics --> | ||
|
||
</head> | ||
|
||
<body <?php body_class(); ?>> | ||
|
||
<div id="container"> | ||
|
||
<header class="header" role="banner"> | ||
|
||
<div id="inner-header" class="wrap clearfix"> | ||
|
||
<div class="heading"> | ||
|
||
<?php lang_switch_link(); ?> | ||
|
||
<a href="<?php echo home_url(); ?>" rel="nofollow"> | ||
|
||
<span class="logo"></span> | ||
|
||
<?php echo get_flatdesign_header_image(); ?> | ||
|
||
<h1 class="title"><?php bloginfo('name'); ?></h1> | ||
|
||
</a> | ||
</div> | ||
|
||
<nav role="navigation"> | ||
<?php bones_main_nav(); ?> | ||
</nav> | ||
|
||
</div> <!-- end #inner-header --> | ||
|
||
</header> <!-- end header --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters