This topic has 11 replies, 2 voices, and was last updated 10 years by Catalin.

  • Author
  • #30807
     alberhd
    Participant

    How can i add the WPML language selector at the right top please?
    WPML give this code to do it,i attach a capture with the example

    <?php do_action('icl_language_selector'); ?>

    Thank you!

    Attachments:
    You must be logged in to view attached files.
    #30819
     Catalin
    Moderator

    copy header.php to your child theme and after this line:

    COPY CODE
    
    
    	<li class="header-register-button"><a href="#"><i class="icon-group hide-for-medium-down"></i> <?php _e("SIGN UP", 'kleo_framework'); ?></a></li> 
    
    

    add

    COPY CODE
    
    <li><?php do_action('icl_language_selector'); ></li>
    

    you may need some css customization…

    let me know if this works…

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #30821
     alberhd
    Participant

    I copy the header.php at functions.php in child theme,but i have this problem

    Fatal error: Call to undefined function sq_option() in /homepages/43/d524894821/htdocs/wp-content/themes/sweetdate-child/functions.php on line 265

    #30824
     alberhd
    Participant

    and something is wrong in the code,dreamwaver found problems with <?php

    <li><?php do_action('icl_language_selector'); ></li>

    Thank you for your help

    #30826
     alberhd
    Participant

    this is the header.php code

    COPY CODE
    <li class="header-login-button"><a href="#" data-reveal-id="login_panel" class="tiny secondary button radius"><i class="icon-user hide-for-medium-down"></i> <?php _e("LOG IN", 'kleo_framework'); ?></a></li>
    
                                <?php if(get_option('users_can_register')) { ?>
    							<li class="header-register-button"><a href="#" data-reveal-id="register_panel" class="tiny button radius"><i class="icon-group hide-for-medium-down"></i> <?php _e("SIGN UP", 'kleo_framework'); ?></a></li>
    							<?php } ?>
    
    						<?php endif; ?>

    The wpml code should be here?

    COPY CODE
    <li class="header-login-button"><a href="#" data-reveal-id="login_panel" class="tiny secondary button radius"><i class="icon-user hide-for-medium-down"></i> <?php _e("LOG IN", 'kleo_framework'); ?></a></li>
    
                                <?php if(get_option('users_can_register')) { ?>
    							<li class="header-register-button"><a href="#" data-reveal-id="register_panel" class="tiny button radius"><i class="icon-group hide-for-medium-down"></i> <?php _e("SIGN UP", 'kleo_framework'); ?></a>
    <strong><li><?php do_action('icl_language_selector'); ></li></strong>
    </li>
    							<?php } ?>
    
    						<?php endif; ?>
    #30829
     Catalin
    Moderator

    test this and let me knwo if it works… the code looks right…

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #30833
     alberhd
    Participant

    I attach the capture with the problem

    Attachments:
    You must be logged in to view attached files.
    #30835
     Catalin
    Moderator
    COPY CODE
    
    
    <?php do_action('icl_language_selector'); ?>
    
    

    u missed the closing question mark for php

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #30839
     alberhd
    Participant

    ok,now no errors,but does not work

    Attachments:
    You must be logged in to view attached files.
    #30915
     Catalin
    Moderator

    credentials not working anymore… I need to take a look and see what settings you have.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #31229
     alberhd
    Participant

    Hello,finally i add the selector to the header,but now,i have two problems:

    1. The name of the languages are not displayed.
    2. The selector autoclose,just i can select the second language,because when i try to down more with the mouse the selector autoclose.

    Thank you for your help Catalin!

    Attachments:
    You must be logged in to view attached files.
    #31274
     Catalin
    Moderator

    not able to login to your site anymore, credentials not working…

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?