Tagged: x
-
AuthorPosts
-
April 11, 2016 at 1:34 pm #876947
Hi, I want to replace the default search bar in the teme with mine. I followed the instruction here: https://community.theme.co/forums/topic/add-shortcode-to-top-menu/. The problem is there is such file named _topbar.php but only _topbar.scss and it can be found under wp-content/themes/x/framework/css/src/site/_scss/stacks/integrity (I am using integrity stack).
The developer of ajax search pro wrote what I have to do, but I do not know what to do exactly. I attach a pic here. Can you help me please? Thank you!
April 12, 2016 at 12:41 am #877685Hi there,
Please copy the file _topbar.php from wp-content/themes/x/framework/views/global and put it in the same path inside child theme which would be wp-content/themes/x-child/framework/views/global. Then you can place provided code in this file.
Add your CSS to customizer or child theme’s style.css file.
Hope it helps.
April 12, 2016 at 2:18 am #877784Hi, thank you for your answer! I copied the file in the right location and I modified the file but it still does not work. this is my code in my _topbar.php
<?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' ) != '' ) : ?> <?php echo do_shortcode('[wpdreams_ajaxsearchpro id=2]') ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php endif; ?> <?php x_social_global(); ?> </div> </div> <?php endif; ?>
If I do not write the ” I receive a parse error on loading of the website, otherwise no error but still no replaced search field, there is still the “old” search icon that works in fullscreen if you click on it. What do have I to do?
April 12, 2016 at 8:50 am #878310Hi there,
Please provide us with your site URL so we can take a closer look to your setup. Please note that we cannot guarantee a solution here as it’s related to a 3rd party plugin.
Thank you!
April 13, 2016 at 4:17 am #879646This reply has been marked as private.April 13, 2016 at 9:25 am #880088Hi there,
Thanks for writing back!
Could you post the FTP details in a private reply as well please? This is so we can access the code of the child theme and make changes as required. 🙂
Thank you!
April 15, 2016 at 10:31 am #884418This reply has been marked as private.April 15, 2016 at 2:22 pm #884717Hi, wit 404 errors (like if you type random page names) there is the ajax search bar, but on the main menu there is still the old search method.
April 16, 2016 at 12:13 am #885277Hi there,
Please activate topbar from Customize -> Header.
Disable navbar search from Customize -> Header -> Search.
Update your code in _topbar.php file to :<?php echo do_shortcode('[wpdreams_ajaxsearchpro id=2]'); ?>
Hope it helps.
April 16, 2016 at 2:53 am #885396Hi, I did exactly as you said and it did not work 🙁
April 16, 2016 at 4:54 am #885537Hi, almost resolved! Problem was the right file was not .topbar but .navbar! Now I have the problem that the main search is too big, and that it does not go inside the mobile navbar but stays on the outside. How to fix it?
April 16, 2016 at 4:57 am #885541From the desktop it is still too big (I can resize it from ajax search pro customization), but I do not know how to increase the distance from the other element (cart), also to have the same padding between elements. My _navbar.php looks like this:
<?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' ); ?> <?php echo do_shortcode('[wpdreams_ajaxsearchpro id=2]'); ?> </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' ); ?> <?php echo do_shortcode('[wpdreams_ajaxsearchpro id=2]'); ?> </div> </div> </div> </div> <?php endif; ?>
April 16, 2016 at 5:23 am #885560I modified the layout of my ajax search and set it as standard search but it does not show up formatted as I did. Why is that? Edit: resolved (at least only this problem)
April 16, 2016 at 7:54 am #885673Hi, I decided to simply not use the bar in the main menu, but only in the product page, in the news page and in the about us page (3 different search bars with 3 differents type of searchable items). it is “resolved” now 🙂
April 16, 2016 at 10:54 pm #886337Glad you’ve sorted it out. 🙂
-
AuthorPosts