BuddyPress Customization – Unites States

,

Client: One Word

Problem and request:

  • Updating WordPress/BuddyPress to the latest version.
  • Turning on comments for both main activity page and user profile page.
  • Turning off Facebook like button for all comments.
  • Making the login form on the admin bar clearable on click.
  • Changing comment text “someone commented on post [post-title]” to “someone wrote about some word [word]”.
  • Turning off comments form for all pages except BuddyPress activity page.
  • Removing “in reply to” in comment entry.
  • Removing “load more” button under main activity page.

Solution:

  • Updated WordPress/BuddyPress to the latest version.
  • Added the following code to functions.php to turn on comments for both main activity page and user profile page :
function bp_activity_do_heartbeat() {
$retval = false;

if ( ! bp_is_activity_heartbeat_active() ) {
return $retval;
}

if ( bp_is_activity_directory() || bp_is_group_activity() ) {
$retval = true;
}

return $retval;
}
  • Commented the following code in functions.php to turn off Facebook like button for all comments:
<iframe src="//www.facebook.com/plugins/like.php?
href=<?php echo $URI;?>comments%3D=<?php comment_ID() ?>
&amp;send=false&amp;layout=button_count&amp;
width=450&amp;show_faces=true&amp;font=lucida+grande&amp;
colorscheme=light&amp;action=like&amp;height=21&amp;
appId=423226747766829" scrolling="no" frameborder="0" 
style="border:none; overflow:hidden; width:450px; height:21px;
" allowTransparency="true"></iframe>
  • Commented the following code in wp-contents/themes/oneword/activity/entry to turn off Facebook like button for comment entry:
<iframe src="//www.facebook.com/plugins/like.php?
href=<?php echo $URI;?>comments%3D=<?php comment_ID() ?>
&amp;send=false&amp;layout=button_count&amp;
width=450&amp;show_faces=true&amp;font=lucida+grande&
amp;colorscheme=light&amp;action=like&amp;height=21&amp;
appId=423226747766829" scrolling="no" frameborder="0" 
style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
  • Added the following code to functions.php “login form” section to make the login form on the admin bar clearable on click:
onfocus="if(this.value == 'value') { this.value = ''; }"
  • Modified the following files to change comment text “someone commented on post [post-title]” to “someone wrote about some word [word]”:

bp-blogs/bp-blogs-activity.php:239
bp-blogs/bp-blogs-activity.php:241
bp-blogs/bp-blogs-activity.php:365
bp-blogs/bp-blogs-activity.php:367

  • Added a filter in wp-content/themes/oneword/activity/activity-loop.php to turn off comments form for all pages except BuddyPress activity page:
<?php if ( bp_has_activities( bp_ajax_querystring( 'activity'). '&action=new_blog_comment') ) : ?>
  • Commented the following lines in wp-content/themes/oneword/activity/entry.php to remove “in reply to” in comment entry:
<?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
<div class="activity-inreplyto">
<strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> 
- <?php bp_activity_parent_content() ?> &bull;
<a href="<?php bp_activity_thread_permalink() ?>
" class="view item-button" title="<?php _e( 'View Thread / Permalink', 'buddypress' ) ?>
"><?php _e( 'View', 'buddypress' ) ?></a>
</div><?phpendif; ?>
  • Commented the following lines in wp-content/themes/oneword/activity/entry.php to remove “load more” button under main activity page:
<?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : 
?><div id="content"><li class="load-more">
<a href="#more"><?php _e( 'Load More', 'buddypress' ) ?>
</a> &nbsp; <span class="ajax-loader"></span>
</li> </div><?php endif; ?>
Skills

Posted on

June 12, 2016

BuddyPress Customization – Unites States

Submit a Comment

Your email address will not be published. Required fields are marked *