Okay
  Public Ticket #2863348
Child theme custom function
Closed

Comments

  • Swolly started the conversation
    Hi,

    i add this action in my child theme functions.php

    add_action('nectar_hook_mobile_header_menu_items', 'display_wpml_language_selector', 10);
    function display_wpml_language_selector() {
        echo '<div style="display: inline-flex;"><div>';
         do_action('wpml_add_language_selector');
        echo '</div></div>';
    }

    but a strange thing happens, it seems to work only when i'm logged.


    Logged (flag is displayed)

    logged.png

    Not logged (flag is not displayed)

    not-logged.png


    if i change function to


    add_action('nectar_hook_mobile_header_menu_items', 'display_wpml_language_selector', 10);
    function display_wpml_language_selector() {
        echo '<div style="display: inline-flex;"><div>';
        echo 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
        echo '</div></div>';
    }

    the same thing happens so it doesn't depend on WPML, it's just a problem with the child theme.


    ty

    swolly

  •  8,846
    Tahir replied

    Hey Again,

    Try adding the function using the "Code Snippets" Plugin and check.

    Thanks


    ThemeNectar Support Team