BuddyBoss Home – Web Support Forums Themes Boss. theme BuddyPress Global Search Plugin Templating

Viewing 12 posts - 1 through 12 (of 12 total)
  • Question

    #40982
    @jreeve

    Hi, apologies if this is the wrong forum, but I can’t seem to find the support forum for the plugin BuddyPress Global Search.

    BuddyPress Global Search isn’t properly loading the header and footer templates of my theme. On the search results page, it returns only the raw search results, and is missing all the other template parts like headers, footers, and so on (including, therefore, CSS and JS).

    What’s strange is that my search results page (template search.php) works fine without BuddyPress Global Search, and BuddyPress Global Search works fine with other themes.

    What I’d like to know is: how does BuddyPress Global Search hook into the search.php template? How does it load or override the templates that are already there? How can I get it to load my template and other template parts properly?

    Thanks very much for any information you can provide! I haven’t had too much luck in the WP plugin forums.

    Answers

    #41026

    Alyssa
    Participant
    @alyssa-buddyboss

    @jreeve we don’t have a dedicated forum for these products, I’ll answer them in any forum you post them to 🙂
    That is some interesting functionality. It would seem your theme might not be using proper WP standards. What theme are you using?

    #41027

    Alyssa
    Participant
    @alyssa-buddyboss

    I believe we are simply editing the content of the default BP search content, so the header and foot should be loaded by the default search template.

    #41077
    @jreeve

    My theme definitely doesn’t use proper WP standards yet, since I’m writing it from scratch, based on the Sage starter theme. Since Sage has a template wrapper, it hijacks the templates early to rewrite them in a DRY fashion. Could that be interfering with the way BuddyPress Global Search injects content into the BP search template? Is the BuddyPress default search template search.php? I’ve tried dropping in a number of other search.phps, like the one from TwentyFifteen, and I still get a bare, headerless and footerless Search Results page no matter what. Is there a way I can filter the way BuddyPress Global Search injects content to the WP search results page, so that it is scoped in such a way as to not interfere with my theme’s handling of headers and footers?

    #48731
    @optimystic

    hi there- I need my buddypress global search to take on our right-sidebar template and not the default template.
    How can I accomplish this?

    Using BuddyBoss 4.2.1. with child theme

    thanks,
    kim, webmaster for http://thinkwithyourheart.com

    #48742

    Anonymous
    @

    Hi @optimystic, to add the search box in your sidebar please add this function in your child theme’s function.php.

    
    function bp_ser_shortcode( $args, $content, $tag ) {
    	global $post;
      if (!is_singular()) {
    	  return '[Search form]';
    	}
    	ob_start();
    	get_search_form(true);
    	$ret = ob_get_contents();
    	ob_end_clean();
    	return "<p>$ret</p>";
    	
    }
    
    add_shortcode( 'search', 'bp_ser_shortcode' );
    

    And then use this shortcode [search] wherever you want to display the search form.

    Regards
    Pallavi

    #48775
    @optimystic

    I don’t need a search box in my sidebar, I need to edit the template that the search page uses. THe search feature, by default uses our default template. I need it to use the template “right sidebar”

    Please advise.

    #48787

    Anonymous
    @

    Hi @optimystic, Please copy the search.php from your main theme to your child theme and then you can apply your edits in search page.

    By default, it shows Default Page Sidebar.

    Regards
    Pallavi

    #48880
    @optimystic

    My developer has attempted to do this, and the plugin templates cannot be overloaded.

    It’s using these templates:
    /wp-content/plugins/buddypress-global-search/templates/

    They are supposed to be over-loadable to child theme, but testing did not work.

    @michael how can we add a sidebar to your search plugin template?

    #48890

    Anonymous
    @

    Hi @optimystic
    You can move following for Boss theme to child theme with same structure
    buddypress-global-search/results-page-content.php
    Regards

    #48995
    @optimystic

    Thank you @vapvarun, unfortunately this doesn’t work.

    I can see the file where you say it should go.
    But still the template being used comes from the plugin.

    And this doesn’t address the issue of how to add a sidebar.
    I already tried it directly in the plugin template files.No go.

    Please advise

    #48998

    Anonymous
    @

    Hi @optimystic
    You can include following codes inside the page.php
    we are generating search results on dummy page which is generated run time without any page id
    thus it is loading on default page.php template file
    you can copy page.php inside the child theme and add the conditional login for the search

    you can call your own registered sidebar inside the is_search condition

    
    <?php if ( is_active_sidebar('sidebar') ) : 
          if(is_search()) { 
    		get_sidebar( 'search' );
    	}
    else 
      {
         get_sidebar('sidebar'); 
      }
    
        endif; ?>
    

    for any content specific customization you can use buddypress-global-search/results-page-content.php
    Regards
    Varun Dubey

Viewing 12 posts - 1 through 12 (of 12 total)
  • The question ‘BuddyPress Global Search Plugin Templating’ is closed to new replies.