Search bar

This topic contains 8 replies, has 4 voices, and was last updated by  Paolo 8 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #291871

    Michael Hulse
    Expired Member
    Post count: 27

    Is it possible to place the main website search bar at the top of every page on my site, underneath the menu?

    #292147

    Kor
    Moderator
    Post count: 16516

    Hi Michael,

    You can use shortcodes to display the search form, check out this section of the documentation https://wpgeodirectory.com/docs/core-shortcodes/#search .

    Thanks!

    #292436

    Michael Hulse
    Expired Member
    Post count: 27

    Hi Kor,

    How would I add the shortcode to show on every page? On my site http://ghosthuntadvisor.com/ I want the search bar if possible to be under where my logo is, but to expand across both of those columns shown. Not just in the left column where it currently is.

    Thanks

    #292972

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    you will need to modify a theme template to achieve that. if you provide admin credentials in a private reply we point you in the right direction.

    Thanks

    #292973

    Kor
    Moderator
    Post count: 16516

    Hi Michael,

    You can use the code below to display it in the header.php file of your theme. Insert below the navigation menu as you requested. Let us know how it goes.

    <?php echo do_shortcode("[gd_advanced_search show_adv_search='always']"); ?>

    Thanks!

    #292978

    Michael Hulse
    Expired Member
    Post count: 27
    This reply has been marked as private.
    #293461

    Giri
    Expired Member
    Post count: 3155

    Hi Michael, I have added the search form as you asked.

    Don’t uninstall “Code Snippets” plugin.

    This is the code I added

    
    
    add_action('dt_after_header', 'dt_custom_after_header');
    function dt_custom_after_header() {
    	echo do_shortcode("[gd_advanced_search]");
    }
    #293952

    Michael Hulse
    Expired Member
    Post count: 27

    Hi

    Is it possible to set the width to the same as the content? I think GD sets this as 1160px.

    Many thanks

    #295203

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I changed the code provided by Giri with this:

    
    
    
    add_action('dt_after_header', 'dt_custom_after_header');
    function dt_custom_after_header() {
    	echo '<div class="container">'.do_shortcode("[gd_advanced_search]").'</div>';
    }

    Please check now.

    Thanks

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount