Skip to content

Instantly share code, notes, and snippets.

@BoweFrankema
Created April 13, 2014 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoweFrankema/10596814 to your computer and use it in GitHub Desktop.
Save BoweFrankema/10596814 to your computer and use it in GitHub Desktop.
WordPress Language Check
<?php
$currentlang = get_bloginfo('language');
?>
<nav class="collapse navbar-collapse" role="navigation">
<?php if($currentlang=="en-US"):?>
<?php
if (has_nav_menu('primary_navigation')) :
wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav navbar-right'));
endif;
?>
<?php elseif($currentlang=="nl-NL"): ?>
<?php
if (has_nav_menu('primary_navigation_nl')) :
wp_nav_menu(array('theme_location' => 'primary_navigation_nl', 'menu_class' => 'nav navbar-nav navbar-right'));
endif;
?>
<?php endif; ?>
<?php
if ( function_exists( 'bp_is_member' ) ) {
get_template_part( 'buddypress/parts/bp-member-nav' );
}
?>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment