WordPress.org

Ready to get started?Download WordPress

Forums

Frisco for BuddyPress
[resolved] Modify Buddypress Search (5 posts)

  1. codegene
    Member
    Posted 1 year ago #

    Now by default in the search bar, members option is selected. When you click on the list other options like forums,groups and post appear. I want to show posts by default in the search bar instead of members. How can i do so?

  2. David Carson
    Member
    Theme Author

    Posted 1 year ago #

    This is not an issue with the Frisco theme necessarily. That functionality is inherited from BuddyPress and the bp-default theme.

    I think the function you're looking to work with is bp_search_form_type_select() and it has a filter. Because this is not an issue with the Frisco theme, I'm going to mark this as resolved. I'd recommend searching or posting in the BuddyPress support forums.

    http://buddypress.org/support/

  3. codegene
    Member
    Posted 1 year ago #

    Thanks very much David! The issue is now resolved.

    I solved the problem by editing bp_search_form_type_select()function in buddypress/bp-core/bp-core-template.php

    I achieved it by placing the blog and posts code ahead of the members code for search bar.

    Here is the modified code:

    function bp_search_form_type_select() {
    
    	$options = array();
            if ( bp_is_active( 'blogs' ) && is_multisite() )
    		$options['blogs']   = __( 'Blogs',   'buddypress' );
            $options['posts'] = __( 'Posts', 'buddypress' );
    
    	if ( bp_is_active( 'xprofile' ) )
    		$options['members'] = __( 'Members', 'buddypress' );
    
    	if ( bp_is_active( 'groups' ) )
    		$options['groups']  = __( 'Groups',  'buddypress' );
    
    	if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && bp_forums_has_directory() )
    		$options['forums']  = __( 'Forums',  'buddypress' );
  4. toposscz
    Member
    Posted 1 year ago #

    There is plugin.

    Enjoy it! ;-)

  5. onapeto
    Member
    Posted 1 year ago #


Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic