BuddyBoss Home – Web › Support Forums › Themes › BuddyBoss theme › Add the user thumb next to the "add a post" textfield in the activity page?
Tagged: activity page, user thumb
- This topic has 14 replies, 2 contibutors, and was last updated 8 years, 11 months ago by Anonymous.
Question
December 10, 2015 at 11:20 am #54149@karloshello,
Great theme!
How can I add the user thumb next to the “add a post” textfield in the activity page?
Please see screenshot I am attaching.Can it be added to the lists of requests so it comes by default in the theme?
Thank you!
Answers
December 10, 2015 at 2:16 pm #54177@
AnonymousHi @karlos, Thanks for your input we will consider it, I will add it to our suggestion list
RegardsDecember 10, 2015 at 2:19 pm #54178@karlosHow can I add it?
December 10, 2015 at 2:20 pm #54179@karlosIt looks nice. i think it is better seeing their photo it encourages user to actually do leave a comment.
December 11, 2015 at 3:19 pm #54266@karlosAny update?
December 12, 2015 at 3:21 am #54291@
AnonymousHi @karlos, add these to custom css
#buddypress form#whats-new-form #whats-new-avatar { display: block !important; float: left; padding-right: 10px; } #buddypress form#whats-new-form p.activity-greeting { margin: 10px 0 10px!important; }
Regards
Varun DubeyDecember 12, 2015 at 9:32 am #54302@karlosWow looks much better!
It would be great to have the thumb actually next to the text box, instead of the salutation message. Li this:
http://buddyboss.clusterinteracti.netdna-cdn.com/wp-content/uploads/2015/12/request.pngRight now it is displaying like this:
https://www.oigente.com/baul-volatil/screen.pngCan you share the css code for that please?
Thank you!
December 13, 2015 at 11:36 am #54337@karlosHello!
Any update?
Thank you!
December 14, 2015 at 9:53 am #54396@
AnonymousCreate a new file with name post-form.php
at path
buddyboss-child/buddypress/activity/post-form.phpIt will allow you to override the Avatar div
Most of area whats-new-textarea is controled by BuddyPress JS and other BuddyPress specific js thus adding new div inside it may cause functionality issue<?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" role="complementary"> <?php /** * Fires before the activity post form. * * @since 1.2.0 */ do_action( 'bp_before_activity_post_form' ); ?> <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 _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 _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 */ do_action( 'bp_after_activity_post_form' ); ?> </form><!-- #whats-new-form -->
Regards
December 14, 2015 at 10:10 am #54398@karlosHello,
I added the file with the code to the child theme and still nothing changed. Please see screenshot.
In addition, there is not such a file post-form.php in the parent theme
at path
buddyboss/buddypress/activity/post-form.phpPlese help.
Thank you
December 14, 2015 at 12:06 pm #54411@
Anonymousyes, it is not available in parent theme
and it still need customization of Avatar div<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>
inside the content area div
Just moving Avatar div inside the content are div will not work properly
It will also need additional custom work.Please wait couple of days i will work on it and will provide complete solution with css.
Regards
December 14, 2015 at 4:01 pm #54437@karlosThank you!
December 16, 2015 at 1:36 pm #54566@
AnonymousHi @karlos
buddyboss-child/buddypress/activity/post-form.php
<?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" role="complementary"> <?php /** * Fires before the activity post form. * * @since 1.2.0 */ do_action( 'bp_before_activity_post_form' ); ?> <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() ) ); ?> <div id="whats-new-content"> <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> <div id="whats-new-textarea"> <label for="whats-new" class="bp-screen-reader-text"><?php _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 _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 */ do_action( 'bp_after_activity_post_form' ); ?> </form><!-- #whats-new-form -->
Along with custom css
#buddypress form#whats-new-form #whats-new-avatar { display: block !important; float: left; padding-right: 10px; } #buddypress form#whats-new-form p.activity-greeting { margin: 10px 0 10px!important; } #buddypress form#whats-new-form p.activity-greeting{ float:none!important; } #whats-new-textarea { float: left; width: 90%; } #whats-new-form{ overflow:hidden; } #whats-new-options{ float:left; width:100%; } @media screen and (max-width:529px){ #whats-new-textarea { width: 78%; } #buddypress form#whats-new-form #whats-new-avatar{ width:auto; } }
It will work.
Regards
December 16, 2015 at 2:27 pm #54580@karlosHello!
Thank you it worked!
But just fyi it worked only with the css code. If using buddyboss-child/buddypress/activity/post-form.php
it displays 2 avatars. So I went ahead and took it out and it works fine only with the css.Cheers
December 17, 2015 at 4:38 am #54605@
AnonymousOkay great 🙂
- The question ‘Add the user thumb next to the "add a post" textfield in the activity page?’ is closed to new replies.