Skip to:
Content
Pages
Categories
Search
Top
Bottom

Categories and Tags from Blog Post in the activity stream

  • Avatar of carmeetsroad
    carmeetsroad
    Participant

    @carmeetsroad

    Hey Guys,

    Im trying to get the CATEGORIES and TAGS from blog posts to appear in the activity stream.

    I have been messing with this in BP

    if ( is_multisite() )
    				$activity_action  = sprintf( __( '%1$s wroteD a new post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' );
    			else
    				$activity_action  = sprintf( __( '%1$s wroteDD a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    

    Any guidance would be appreciated..

    cc: @modemlooper

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of jyoti18
    jyoti18
    Participant

    @jyoti18

    While creating WordPress blog you would have to manually add the categories and tags and after this it will appear in the activity stream.

    http://www.newvays.com

    Avatar of carmeetsroad
    carmeetsroad
    Participant

    @carmeetsroad

    It only shows you the Title of the Post and Which blog it was posted in.. not the TAG or Category associated with it..

    :/

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Avatar of carmeetsroad
    carmeetsroad
    Participant

    @carmeetsroad

    @shanebp — Tried the sample code:

    <?php
    echo get_the_tag_list('<p>Tags: ',', ','</p>');
    ?>

    But It fails to appear on the activity stream… DONT I HAVE TO create a function for it in the activity-loop or functions.php or something.. so it “Records” that.. similarly to how it does Username “wrote a new post” this in BlogNAME, BlogTitle

    (sorry.. im totally clueless) any guidance would be appreciated

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    untested:

    $activity_action = sprintf( __( '%1$s wroteDD a new post, %2$s, in %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', get_the_category_list( ', ', '', $post->ID ) );

    Avatar of carmeetsroad
    carmeetsroad
    Participant

    @carmeetsroad

    Thanks @shanebp ! – That works! (sorta) experimenting with it.. :)

    — The bad thing I did was shoe horn that code on to bp-blogs/bp-blogs-functions.php

    *Im trying to figure out how to easily just pop in get_the_category_list and get_the_tag_list in the “entry.php” – of my template.

    — Anyone know, point me to the right direction or code snippet to get to that?

    Cheers,

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.