BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: [Resolved] Create activity search form #52461

    Hello Sunny,

    Try the following way:

    
    <?php if ( function_exists( 'bp_is_activity_directory' ) && bp_is_activity_directory() ) : ?>
        <?php echo do_shortcode('[bp-activity-search-form]'); ?>
    <?php endif; ?>
    
    

    Give it a try.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: Buddypress Clear Notifications Plugin #52460

    Hello,

    Thank you for posting here. I have checked it with “BuddyPress 12.4.1” and it is working fine so you can use it without any issues. Please give it a try.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: [Resolved] Create activity search form #52446

    Hello Sunny,

    Thank you for the acknowledgement. You can use the ‘bp_is_activity_directory’ function to make sure it shows only on the activity directory page. Please give it a try.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: [Resolved] Create activity search form #52401

    Hello Sunny,

    Thank you for the acknowledgment. Please place the following code in the “bp-custom.php” file or your active theme “functions.php” file.

    
    add_shortcode( 'bp-activity-search-form', function ( $atts ) {
    
    	if ( ! function_exists( 'bp_get_activity_directory_permalink' ) ) {
    		return '';
    	}
    
    	$atts = shortcode_atts(
    		array(
    			'label'     => __( 'Search Activities', 'bp-custom' ),
    			'btn_label' => __( 'Search', 'bp-custom' ),
    		),
    		$atts
    	);
    
    	ob_start();
    
    	?>
    	<div class="bp-activity-search-form">
    		<?php if ( $atts['label'] ) : ?>
    			<h4><?php echo esc_html( $atts['label'] ); ?></h4>
    		<?php endif; ?>
    		<form action="<?php echo esc_url( bp_get_activity_directory_permalink() ); ?>" method="get">
    			<input type="text" name="s">
    			<input type="submit" class="button" value="<?php echo esc_attr( $atts['btn_label'] ); ?>">
    		</form>
    	</div>
    	<?php
    
    	return ob_get_clean();
    } );
    
    

    Please use the shortcode “[bp-activity-search-form]”. It only works with the activity directory page. Please give it a try and let me know.

    To more info on “bp-custom.php” check here: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: [Resolved] Create activity search form #52358

    Hello Sunnybuddy,

    Thank you for the acknowledgement. As you said you are using the older BuddyPress which is why there is no activity search form in the latest version you can find it on the Activity directory page. But to check whether activity search is supported on your setup just try to add “?s=text-to-search” with the URL on the directory page and check whether it shows results or not. If it shows the expected result you can create a search form using HTML and make it searchable.

    Please give it a try.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: [Resolved] Custom cover photo by role #52352

    Hello La,

    Thank you for the acknowledgement. I am glad that I could help.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: [Resolved] Custom cover photo by role #52345

    Hello La,

    Thank you for the acknowledgement. I am glad that it worked. Just comment or delete the following code:

    
    else {
    		$settings['default_cover'] = 'http://example.com/cover.jpg';
    	}
    
    

    With this step, no default cover will apply if the user does not have the mentioned role in the conditions.

    Please check.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2953
    Ravi on in reply to: [Resolved] Create activity search form #52341

    Hello Sunnybuddy,

    Welcome to the BuddyDev forums. Please let me know which theme or BuddyPress template pack you are using so that I can help. Also, let me know if you are using Youzify yes or no.

    Regards
    Ravi