Tagged: x
-
AuthorPosts
-
March 1, 2017 at 7:44 pm #1391247
Hi,
I’ve followed the thread here: https://community.theme.co/forums/topic/google-translate-flags-in-topbar-or-menubar/ to successfully ad Google translate to the topbar of my site. But I can’t get it to line up with the page content- it is floating to the absolute right. Can you please explain how to get it to line up with the menu?I also want to include a search function alongside it. How can I achieve this as well?
dev site: lpps1.minkacreativestudio.com.au
X version: 4.6.4
Wpress: 4.7.2Thanks
March 1, 2017 at 7:48 pm #1391285This reply has been marked as private.March 2, 2017 at 1:29 am #1391509Hello Felicity,
Would you mind giving us FTP credentials too?
Topbar container should align it by default. But then on your site, x-container class is set to be x-container-fluid. See this:http://screencast-o-matic.com/watch/cbenit6TI3March 2, 2017 at 1:57 am #1391531Oh, that is in the code supplied in the thread I mentioned above! I’ve removed it and updated as your video shows and it works perfectly! Thanks
How do I go about placing the search function from the widget sidebar alongside the translate function in the topbar?
March 2, 2017 at 1:58 am #1391532This is what it reads now.
<?php // ============================================================================= // VIEWS/GLOBAL/_TOPBAR.PHP // ----------------------------------------------------------------------------- // Includes topbar output. // ============================================================================= ?> <?php if ( x_get_option( 'x_topbar_display', 0 ) == 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(); ?> <div class="gtranslate" style="float:right;"><?php echo do_shortcode('[gtranslate]'); ?></div> </div> </div> <?php endif; ?>
March 2, 2017 at 5:12 am #1391669Hi,
Please change your code to this.
<?php // ============================================================================= // VIEWS/GLOBAL/_TOPBAR.PHP // ----------------------------------------------------------------------------- // Includes topbar output. // ============================================================================= ?> <?php if ( x_get_option( 'x_topbar_display', 0 ) == 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(); ?> <div class="gtranslate" style="float:right;"><?php echo do_shortcode('[gtranslate]'); ?></div> <form style="float:right;" method="get" id="searchform" class="form-search" action="http://lpps1.minkacreativestudio.com.au/"> <label for="s" class="visually-hidden">Search</label> <input type="text" id="s" class="search-query" name="s" placeholder="Search"> </form> </div> </div> <?php endif; ?>
Hope that helps
March 2, 2017 at 5:05 pm #1392524That’s fantastic. One last thing, how can I make it line up and have padding between it and the translate widget?
March 2, 2017 at 5:16 pm #1392546Actually, I worked it out and here’s what I added to the custom css:
.form-search { margin: 10px; } .form-search .search-query { height: 2.2em; border: 1px solid #ddd; font-size: 12px; }
March 2, 2017 at 5:59 pm #1392586Happy to hear that.
Feel free to ask us again.
Thanks.
March 2, 2017 at 6:24 pm #1392605Can I ask one last thing? Given that I’ve now achieved all this with my topbar, how can I make it sticky as well?
March 3, 2017 at 1:15 am #1392997Hi,
To make it sticky, you can add this under Custom > Edit Global CSS in the Customizer.
.x-topbar { position: fixed; width: 100%; top: 0; } .x-navbar { margin-top:58px; } .x-navbar.x-navbar-fixed-top { margin-top:0; top:58px; }
Hope that helps.
-
AuthorPosts