-
Hello. I would like to have the WPML language selector (only flags) in the menu.
To do that, I must insert the following code in the functions.php file.
It work fine but unfortunately there are 6 validation errors, that’s because the flags is added in “select…” “/select” tags.Please, do you know if is possible to to avoid these problems?
This is the code that I put in the functions.php file:
// Filter wp_nav_menu() to add additional links and other output
function new_nav_menu_items($items) {
if (function_exists(‘icl_get_languages’)) {
$languages = icl_get_languages(‘skip_missing=0′);
if(1 < count($languages)){
foreach($languages as $l){
if(!$l){
$items = $items.’‘;
}
}
}
}return $items;
}
add_filter( ‘wp_nav_menu_items’, ‘new_nav_menu_items’ );Thank you.
- Theme support is offered to verified customers only. To post a topic go to your Theme Category and add your question at the page bottom.
Theme Categories
Recent Topics
- Alea updates
- Why "Fortune" theme is no longer available?
- PHP 8.1 Error
- Issue with WPB editor icons
- Issue with Icons and Text Alignment for Arabic Content
- Installing and Activating Plugin Fortuna Portfolio CPT (1/8)
- Testimonials page is blank
- warning boc_framework line 905
- Transparent header issue without changes
- Slider Revolution error