-
AuthorPosts
-
August 4, 2015 at 6:36 am #349536
Hello,
I use the latest version of the theme and just now have installed the WMPL plugin and have it set up, but it doesn’t show any language selector in the header or footer.
Can you help me to set up in properly with your theme? I’m not into PHP or something, I can’t dig into code myself. I have this manual on how to set up selector for the footer:
https://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/
Could you help me to include the selector into header here: http://take.ms/wr1Ad ? Just right after the text in top bar.
I can style it myself via some CSS, but I don’t really know how to put the selector into header.
Also, could you please tell if the instructions in the manual above are sufficient to put the selector into footer of your theme? I mean, will it work, is it compatible with your theme? Since it’s very complex theme with Cornerstone plugin and stuff.
Thank you in advance.
—
AlexAugust 4, 2015 at 7:34 am #349583Hi Alex,
Thanks for writing in! Since WPML is a 3rd party plugin, we only provide support for its compatibility issues. Any other customization such as adding language selector to the footer can be achieved with custom development but would fall outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Thanks for understanding. Take care!
August 4, 2015 at 8:21 am #349631Okay, thank you.
August 4, 2015 at 8:48 am #349655You’re most welcome 🙂
August 4, 2015 at 8:55 am #349666One more thing, though. 🙂
Could you at least tell me where I should put this PHP code
<?php do_action(‘wpml_add_language_selector’); ?>
if I want to put this into top bar on the right, after the text?
It would really help and it’s not like development thing, it’s more of a locating some file.
Thanks, anyway.
August 4, 2015 at 9:36 am #349706Hi There,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then navigate to your child theme’s /framework/views/global directory create a file named _navbar.php and paste the code below:<?php // ============================================================================= // VIEWS/GLOBAL/_NAVBAR.PHP // ----------------------------------------------------------------------------- // Outputs the navbar. // ============================================================================= $navbar_position = x_get_navbar_positioning(); $logo_nav_layout = x_get_logo_navigation_layout(); $is_one_page_nav = x_is_one_page_navigation(); ?> <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?> <div class="x-logobar"> <div class="x-logobar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_brand' ); ?> </div> </div> </div> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_nav', 'primary' ); do_action('wpml_add_language_selector'); ?> </div> </div> </div> </div> <?php else : ?> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_brand' ); ?> <?php x_get_view( 'global', '_nav', 'primary' ); ?> </div> </div> </div> </div> <?php endif; ?>
Hope it helps.
August 4, 2015 at 9:42 am #349716Thanks. I already use child theme. I did as you told me, but that didn’t help. I think I have to wait for support from WPML team.
Thank you, anyway!
August 4, 2015 at 10:37 am #349773The workaround may not work depending on your setup or the incorrect code. As this is a custom development, regretfully we cannot provide support for it. You may contact our trusted development partners for custom development: https://community.theme.co//custom-development/
Thanks for understanding. Take care!
August 5, 2015 at 6:35 am #350651Thanks for recommendation, but I don’t have the budget to use some developer. Can you help me a little bit more?
I contacted the WMPL support and they gave me this code based on the code you gave me earlier:
<?php // ============================================================================= // VIEWS/GLOBAL/_NAVBAR.PHP // ----------------------------------------------------------------------------- // Outputs the navbar. // ============================================================================= $navbar_position = x_get_navbar_positioning(); $logo_nav_layout = x_get_logo_navigation_layout(); $is_one_page_nav = x_is_one_page_navigation(); ?> <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?> <div class="x-logobar"> <div class="x-logobar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_brand' ); ?> </div> </div> </div> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_nav', 'primary' ); do_action('wpml_add_language_selector'); ?> </div> </div> </div> </div> <?php else : ?> <div class="x-navbar-wrap"> <div class="<?php x_navbar_class(); ?>"> <div class="x-navbar-inner"> <div class="x-container max width"> <?php x_get_view( 'global', '_brand' ); ?> <?php x_get_view( 'global', '_nav', 'primary' ); do_action('wpml_add_language_selector'); ?> </div> </div> </div> </div> <?php endif; ?>
And now the selector appeared, but not in the top bar, it appeared in the left nav bar:
So how can I move it to the top bar position I marked on the screenshot? Since I managed to get it work and appear on the site, now it’s the matter of putting selector code properly into your top bar file as I understand it. Please help me once more with it.
Thank you.
August 5, 2015 at 6:36 am #350654Also, if I want to put selector in the footer, what theme file should I edit and copy to the child theme folder?
Thanks!
August 5, 2015 at 7:32 am #350715Hi,
Please create file _topbar.php in wp-content/themes/x-child/framework/views/global
and copy the code below into that file.<?php // ============================================================================= // VIEWS/GLOBAL/_TOPBAR.PHP // ----------------------------------------------------------------------------- // Includes topbar output. // ============================================================================= ?> <?php if ( x_get_option( 'x_topbar_display', '' ) == '1' ) : ?> <div class="x-topbar"> <div class="x-topbar-inner x-container max width"> <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php endif; ?> <?php x_social_global(); ?> <?php do_action('wpml_add_language_selector'); ?> </div> </div> <?php endif; ?>
Then create file wp-footer.php in wp-content/themes/x-child/framework/views/integrity
and copy the code below into that file.<?php // ============================================================================= // VIEWS/INTEGRITY/WP-FOOTER.PHP // ----------------------------------------------------------------------------- // Footer output for Integrity. // ============================================================================= ?> <?php x_get_view( 'global', '_header', 'widget-areas' ); ?> <?php x_get_view( 'global', '_footer', 'scroll-top' ); ?> <?php x_get_view( 'global', '_footer', 'widget-areas' ); ?> <?php if ( x_get_option( 'x_footer_bottom_display', '1' ) == '1' ) : ?> <footer class="x-colophon bottom" role="contentinfo"> <div class="x-container max width"> <?php if ( x_get_option( 'x_footer_menu_display', '1' ) == '1' ) : ?> <?php x_get_view( 'global', '_nav', 'footer' ); ?> <?php endif; ?> <?php if ( x_get_option( 'x_footer_social_display', '1' ) == '1' ) : ?> <?php x_social_global(); ?> <?php endif; ?> <?php if ( x_get_option( 'x_footer_content_display', '1' ) == '1' ) : ?> <div class="x-colophon-content"> <?php echo x_get_option( 'x_footer_content' ); ?> </div> <?php endif; ?> <div class="l-selector"><?php do_action('wpml_add_language_selector'); ?></div> </div> </footer> <?php endif; ?> <?php x_get_view( 'global', '_footer' ); ?>
As this is a custom development, further customizations from here is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities. https://community.theme.co//custom-development/
Thank you for understanding. Take care!
August 6, 2015 at 8:19 am #351896Thank you.
August 6, 2015 at 10:39 am #352007You are most welcome 🙂 .
-
AuthorPosts