[Resolved] Can't not use WPML Shortcodes in Adding HTML Inside the Mobile Header

Home Forums Support [Resolved] Can't not use WPML Shortcodes in Adding HTML Inside the Mobile Header

Home Forums Support Can't not use WPML Shortcodes in Adding HTML Inside the Mobile Header

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #625524
    Hieu

    Hi there, I use code below to add WPML Translator near my mobile logo in functions.php but not working !
    Please tell me why and how to fixed this problem ?
    It’s only show text [wpml_language_selector_widget]

    add_action( ‘generate_inside_mobile_header’,’tu_mobile_header_html’ );
    function tu_mobile_header_html() { ?>

    [wpml_language_selector_widget] #Shorcodes not working

    <?php }

    GeneratePress 2.1.3
    GP Premium 1.6.2
    #625552
    David
    Staff
    Customer Support

    Hi there try this:

    add_action( ‘generate_inside_mobile_header’,’tu_mobile_header_html’ );
    function tu_mobile_header_html() { ?>
        <?php echo do_shortcode( '[YOUR SHORTCODE]' ); ?>
    <?php }
    #625573
    Hieu

    Thanks but it’s not working 🙁
    It’s just showing a white dote near Logo, I don’t know why -_-

    #625596
    David
    Staff
    Customer Support

    Hi there, add this CSS:

    .wpml-ls-statics-shortcode_actions ul {
        display: block;
    }

    If you want to place it between the logo and nav then this:

    .wpml-ls-statics-shortcode_actions {
        -webkit-box-ordinal-group: 4;
        -ms-flex-order: 3;
        order: 3;
        -ms-flex-item-align: center;
        align-self: center;
    }
    #625875
    Hieu

    Thanks a lot, it’s working 😀

    #625883
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.