How to remove the ‘What’s New?’ form and RSS from the Activity page?
-
Hi,
I am currently stuck. I want to remove the ‘What’s New?’ form on the activity pages on my site, both the main activity page and the one in the user profile. Also, I want to remove the RSS feed and button from the Activity page.
How do I do that?
I really hope you can help me out. Thanks!
-
Have you looked at overloading your BuddyPress pages?
This is the process of getting BuddyPress to load your costomised pages instead of the default pages. For example, the page that loads the “What’s new” section and post form is located in
plugins/buddypress/bp-templates/bp-legacy/buddypress/activity.posts-form.php
If you copy this file to
themes/your-child-theme/buddypress/activity/posts-loop.php
you can edit this file and remove the “What’s new” section. You would need to know php to do this.More information on overloading bp templates is located here: https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/
A plugin that tries to make the management of your overloads easier is https://wordpress.org/plugins/bp-template-overloader/
Hi Venutius!
Thank you so much for your answer. Can you or maybe someone else provide me with directions on what php coding needs to be done for me to remove the ‘What’s new’ section? I don’t really know much about php.
Best regards
The following change will remove the What’s New area from the Activity page, it will still be visible in Groups and on the users profile activity page.
You will need to set up a childtheme (there’s plenty of plugins that will do this for you).
<?php /** * BuddyPress - Activity Post Form * * @package BuddyPress * @subpackage bp-legacy */ ?> <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form"> <?php /** * Fires before the activity post form. * * @since 1.2.0 */ do_action( 'bp_before_activity_post_form' ); if ( bp_is_my_profile() || bp_is_group() ) : ?> <div id="whats-new-avatar"> <a href="<?php echo bp_loggedin_user_domain(); ?>"> <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?> </a> </div> <p class="activity-greeting"><?php if ( bp_is_group() ) printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) ); else printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) ); ?></p> <div id="whats-new-content"> <div id="whats-new-textarea"> <label for="whats-new" class="bp-screen-reader-text"><?php /* translators: accessibility text */ _e( 'Post what\'s new', 'buddypress' ); ?></label> <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10" <?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?> ><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea> </div> <div id="whats-new-options"> <div id="whats-new-submit"> <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" /> </div> <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?> <div id="whats-new-post-in-box"> <?php _e( 'Post in', 'buddypress' ); ?>: <label for="whats-new-post-in" class="bp-screen-reader-text"><?php /* translators: accessibility text */ _e( 'Post in', 'buddypress' ); ?></label> <select id="whats-new-post-in" name="whats-new-post-in"> <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option> <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0&update_meta_cache=0' ) ) : while ( bp_groups() ) : bp_the_group(); ?> <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option> <?php endwhile; endif; ?> </select> </div> <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> <?php elseif ( bp_is_group_activity() ) : ?> <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" /> <?php endif; ?> <?php /** * Fires at the end of the activity post form markup. * * @since 1.2.0 */ do_action( 'bp_activity_post_form_options' ); ?> </div><!-- #whats-new-options --> </div><!-- #whats-new-content --> <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?> <?php /** * Fires after the activity post form. * * @since 1.2.0 */ endif; do_action( 'bp_after_activity_post_form' ); ?> </form><!-- #whats-new-form -->
Just place this file content in your themes/child-theme/buddypress/activity/post-form.php file. Activity, replacing everything that’s in the current file.
If you want an easier way to manage your template overloads you should look at BP Template Overloader, which will help you keep track. When you overload a theme page, you need to remember that you will have to take responsibility for keeping it up to date since any changes to the master file will no longer be loaded.
- You must be logged in to reply to this topic.