Tagged: x
-
AuthorPosts
-
June 22, 2016 at 2:48 pm #1054979
Kerri SParticipantCould you tell me how to add a google translate widget directly above my logo as shown in the attached image? I don’t want it in top bar, I want it right above the logo.
WP v 4.5.2
Cornerstone v 1.2.4Thanks so much.
June 22, 2016 at 8:56 pm #1055565
RadModeratorHi there,
Thanks for writing in.
Would you mind providing your site’s URL and the google translate code? It may be possible through jQuery.
Thanks!
June 22, 2016 at 8:59 pm #1055569
Rue NelModeratorHello There,
Thanks for writing in! Since you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file<?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 // Google Translator here ?> <?php echo do_shortcode('[google-translator]'); ?> <?php // Google Translator here ?> <?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' ); ?> </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; ?>3] Save the file named as
_navbar.php
4] Upload this file to your server in the child theme’s folder
wp-content/themes/x-child/framework/views/global/We would loved to know if this has work for you. Thank you.
June 23, 2016 at 7:48 am #1056238
Kerri SParticipantWhoa! It totally broker my site LOL! I removed the file and it’s back to normal.
I’ll attach screens in a private reply for you to view.Your instructions were very clear and easy to understand. Thanks for trying!
June 23, 2016 at 7:51 am #1056244
Kerri SParticipantThis reply has been marked as private.June 23, 2016 at 7:57 am #1056252
Kerri SParticipantThis reply has been marked as private.June 23, 2016 at 11:35 am #1056604
JadeModeratorHi Kerri,
I could see that you are trying to add the Google Translate widget in the topbar. By default, shortcodes do not work in the topbar. To enable it, kindly add this code in the function.php in the child theme:
add_filter('x_option_x_topbar_content', 'top_bar_content_shortcode'); function top_bar_content_shortcode ( $content ) { return do_shortcode ( $content ); }Hope this helps.
June 23, 2016 at 1:42 pm #1056769
Kerri SParticipantHi Jade,
Actually, I’m looking to have it right above the logo as shown in the screen shot.I was just testing it there to see what it looked like.
June 23, 2016 at 6:40 pm #1057156
JadeModeratorHi Kerri,
I tried the code suggested in response #1055569 and it is working fine except the flag are aligned to the left.
To solve that you can add this CSS:
#flags { width: 60px !important; margin: 0 auto; }Kindly adjust the value of the width for flags id in the CSS to contain the flag in one line.
Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1054979 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
