Tagged: group name in post
Hi, im using your greate pluging “BP Simple Front End Post”…thanks for do it ๐
When the group administrator create a post (from the group) the post sow the title , content and pictures. I would like to show the name of the group as a link on the post…i was trying to add some code but i am beginer in php and dont find the solution…
I find out at \buddyblog\template\buddyblog\single.php the code that show the post information…and y add the code:
<a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a>
But i didnยดt get exit…:(
I think is because I must let it know which group was the one that created the post…but i not have any idea…
Any help or guide will be very helfull.Thanks for all
Hi Alejandro,
Thank you for using our plugins.BuddyBlog does not allow posting to groups. Are you using blog categories for groups? If yes, we do store group id as post meta and can provide code to assist you with it.
Regards
BrajeshHi , now i underestand what you mean…sorry for the inconvenience…
if i unistall buddyblog, then i can add the code into the blog categories for groups…because blog categories store the grup id as post meta…:) Thanks i tried and is run suscesful ๐ thanks from show me…now i think i now a bit more about how is work…
My interest now is show the grup name on the post detail (if you go to the general post list, where all the posts of all groups appear, and select one post, then you go to the post detail). I think mybe these depent on muy theme… In these case, any clue how to do it?
Thanks for your atentionHi Alejandro,
Thank you for the reply.You may use this snippet inside the post loop
$group_id = get_post_meta( get_the_ID(), '_bcg_group_id', true ); if ( $group_id ) { $group = groups_get_group( $group_id ); printf( "<a href='%s'>%s</a>", esc_url( bp_get_group_permalink( $group ) ), bp_get_group_name( $group ) ); }
That will show the link to the associated group.
Regards
Brajesh
The topic ‘ [Resolved] Add Group name on the post group’ is closed to new replies.