Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • 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.

    in reply to: WPML language switcher doesn't work, repositioning of flag #526555

    Hi 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;
    }

    Hi Andy,

    That’s perfect, I’ll use this option.

    Thanks!

    Steffen

    The 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”>' . $l['language_code'] . '‘ .$items;
    }
    }
    }

    return $items;
    }
    add_filter(‘wp_nav_menu_items’, ‘fixed_nav_menu_items’);

    Is there something similar for the search function?

    All the best,
    Steffen

    in reply to: unwanted footer break #513356

    Hi Elliott,

    Thanks a lot for the quick reply! I could solve it with your help.

    All the best,
    Steffen

Viewing 5 posts - 1 through 5 (of 5 total)