Skip to:
Content
Pages
Categories
Search
Top
Bottom

Removing Blog Posts form the SWA Widget

  • @avim

    Participant

    Removing Blog Posts form the SWA Widget

    Hi there.

    Is there a way to remove ‘blog posts’ from being displayed on the site wide activity widget? I’m not looking to have ‘blog posts’ removed from the activity stream just form the activity stream widget. Right now the way I have things set up posts are showing up in duplicate. Home Left has the paginated site wide posts widget and home center is the activity stream widget.

    I’ve looked around for a solution but so far no luck. I originally this same question over a paysite I subscribe to and apparently their best advice for me was to repost here, so that’s what I’m doing!

    I was thinking maybe a plugin or something like an easy file edit?

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • @avim

    Participant

    Anyone?

    @chouf1

    Participant

    Deactivate one of these widget: SWA or recent post ?

    @boonebgorges

    Keymaster

    avim – I had to do something similar recently, and I came up with code along these lines. It’s not perfect (and might only work in 1.2) but it should give you an idea of how such a thing might be done by filtering the output of bp_has_activities:

    function bp_remove_blogs_activity( $a, $activities ) {
    foreach ( $activities->activities as $key => $activity ) {
    if ( $activity->component == 'blogs' )
    unset( $activities->activities[$key] );
    }

    /* Renumber the array keys to account for missing items */
    $activities_new = array_values( $activities->activities );
    $activities->activities = $activities_new;
    return $activities;
    }
    add_action( 'bp_has_activities', 'bp_remove_blogs_activity', 10, 2 );

    @avim

    Participant

    “Chou not sure I follow you.

    the way I have things set up on my front page is like this.

    Left column = Site wide recent posts widget and next to that center column = site wide activity widget.

    I like having the site wide activity stuff like blogs, friends and groups but having the blog posts also included in the recent site wide widget creates duplicate a duplicate display of recent blogs posts on the front page. Really looks pad when there is an image in the post.

    I`m just looking for a way to remove recent blog posts from the site wide activity display widget.

    Make sense?

    @Bone Ty its late so Il have a look later this week and see if i can get that to work.

    thanks for the replies guys!

    @helloari

    Participant

    FYI the ‘delete’ button in site wide activity didn’t work for me (bp 1.1) but this fix worked:
    http://www.bestbop.com/sitedev/topic.php?id=4

    @ripulkr

    Participant

    I know this is a 4 year old thread, but the code fix still works. The only problem is that it does not reset the pagination. I get blank pages in pagination while doing this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Removing Blog Posts form the SWA Widget’ is closed to new replies.
Skip to toolbar