Replace search bar with global site search

would anyone show me how to replace the default search bar with Global Site Search bar?


  • DavidM

    Hi KevinAriel and welcome to the forums!

    Per our discussion in chat I took a closer look into this matter and basically, you'll find Network theme's search bar code in: /network/library/components/discover-header.php

    And line 530 of global-site-search.php begins the code used to display the search input in the widget.

    As I mentioned in chat, it's a bit extensive for support purposes here, but you may be able to simply copy the widget code and paste it somewhere in place of the Network theme's search bar code.

    Hope that helps!


  • DavidM

    Hi KevinAriel,

    In discover-header.php, you'll see the search form in two places, one for if BuddyPress is being used alongside the theme, the other if not.

    If BuddyPress is active on a site, the theme loads the search form from lines 5 to 11.

    If BuddyPress is not active, the theme loads the search form all from line 13.

    You may be able to simply paste the code from the global site search widget section I mentioned right in place of those lines to achieve this.

    Having not tried it myself, I'm not totally sure that's all that would be needed, but would be happy to know if that's all that's needed for this!


  • Tim Watt


    I started on the road to replacing the built in Search with Global Site Search but notice this requires Post Indexer, which can only index subsequent posts, so can't serve any purpose for a search facility after a site is launched.

    The Post Indexer is designed to index posts from the time it is installed on your site. It can't index posts that were published prior to being installed. i.e. posts published prior to it being installed won't display in your Recent Global posts widget

    It would be nice if the built in Search facility worked better, and reflected the situation where Groups and Forums are turned off....


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.