Forum Replies Created
-
AuthorPosts
-
October 4, 2016 at 9:33 am in reply to: Mailchimp Integration Is Not Working – Let's Fix This! #694937
Same issue here… If you know, that it doesn’t work, please delete it from the Content Element list. Otherwise it is just frustrating.
October 29, 2015 at 7:28 am in reply to: WPML language switcher doesn't work, repositioning of flag #526555Hi Ismael,
I solved the issue using your code together with one provided by WPML, see the code below.
Thanks for your help!
All the best,
Steffen<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ add_action('after_setup_theme','avia_remove_main_menu_flags'); function avia_remove_main_menu_flags(){ remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 ); remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 ); remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10); } // Filter wp_nav_menu() to add additional links and other output // Show only other language in language switcher add_filter('wp_nav_menu_items', 'new_nav_menu_items', 10, 2); function new_nav_menu_items($items, $args) { // uncomment this to find your theme's menu location //echo "args: <pre>"; print_r($args); echo "</pre>"; // add $args->theme_location == 'primary-menu' in the conditional if we want to specify the menu location. // if (function_exists('icl_get_languages') && $args->theme_location == 'avia') { if (function_exists('icl_get_languages')) { $languages = icl_get_languages('skip_missing=0'); if(!empty($languages)){ foreach($languages as $l){ if(!$l['active']){ // flag with native name //$items = $items . '<li class="menu-item"><a href="' . $l['url'] . '"><img src="' . $l['country_flag_url'] . '" height="12" alt="' . $l['language_code'] . '" width="18" /> ' . $l['native_name'] . '</a></li>'; // only flag $items = $items . '<li class="menu-item menu-item-language"><a href="' . $l['url'] . '"><img src="' . $l['country_flag_url'] . '" height="12" alt="' . $l['language_code'] . '" width="18" /></a></li>'; } } } } return $items; }
October 18, 2015 at 8:21 pm in reply to: Different menus per page – adding search icon/language selector #520679Hi Andy,
That’s perfect, I’ll use this option.
Thanks!
Steffen
October 16, 2015 at 8:16 am in reply to: Different menus per page – adding search icon/language selector #519700The main question currently is: Is it possible to include the search icon to more than one nav menu? The option in the Enfold configuration allows only to display it in the main menu.
I found a solution for the WPML language switcher. I added this code to Enfold Child: Theme Functions (functions.php)
function fixed_nav_menu_items($items) {
if (function_exists(‘icl_get_languages’)) {
$languages = icl_get_languages(‘skip_missing=0’);
if (!empty($languages)) {
foreach ($languages as $l) {
if(!$l[‘active’]) $items = ‘<li class=”menu-item custom-switcher”>‘ .$items;
}
}
}return $items;
}
add_filter(‘wp_nav_menu_items’, ‘fixed_nav_menu_items’);Is there something similar for the search function?
All the best,
SteffenHi Elliott,
Thanks a lot for the quick reply! I could solve it with your help.
All the best,
Steffen -
AuthorPosts