Displaying forum topic tags
-
You can enter tags on your forum topics but they don’t actually show up anywhere in the default theme. Here’s a little code (mostly lifted from the Kakumei theme that comes with bbPress) that you can put into your theme’s groups/single/forum/topic.php where you want forum topics to appear:
<?php
$topic_id = bp_get_the_topic_id();
$topic = get_topic( get_topic_id( $topic_id ) );
?>
$topic ) ); ?>
<?php printf(__('No tags yet.'), bb_get_tag_page_link() ); ?>
-
I guess I’ll do it in pastebin:
http://pastebin.com/hXgfJnY1PS you’ll probably want to style that ul.
i use this and works as well
<div id=”topic-tags”>
<p><?php _e(‘Tags:’); ?></p>
<?php
$ttags = bb_get_topic_tags( bp_get_the_topic_id() );
if ( $ttags ) : ?>
<?php bb_list_tags( ‘topic=’. bp_get_the_topic_id() .’tags=’.$ttags ); ?>
<?php else : ?>
<p><?php printf(__(‘No <a href=”%s”>tags yet.’), bp_get_forum_directory_permalink() . ‘/#tags’ ); ?></p>
<?php endif; ?>
</div>Is there any way to show all the groups forum tags on the group page?
@boonebgorges @nuprn1 thanks for posting the instructions. It answered my query. I think it’s odd that topic tags don’t show up in threads in the default theme. Anyway, it works Next thing BP needs to do is provide a forum tag manager tool (unless there’s already one and I didn’t see it) similar to Dashboard > Posts > Post Tags and allow the topic creators to edit tags like they can their Title and Content under Edit Topic. Right now I have to do forum tag management using phpMyAdmin.
@boonebgorges @nuprn1 I tried both of these snippets in a new forum with TAGS i added and neither of them are showing the topic tags…
I posted this in the topic.php direclty under the
items… Any idea as to why these won’t show up? BP 1.2.5.2 WP 3.0.1
direcly under the:
-?php do_action( ‘bp_before_group_forum_topic’ ) ?-
-?php if ( bp_has_forum_topic_posts() ) : ?-Ok, I can get @nuprn1 s to work (had to change the quotes back to normal in the cut& paste). How can I make this a tag cloud? Is there a plugin for this… It is simply long-listing them….
Ok… so I’m looking at this, I guess what I really want to do is show a Tag Cloud of the Forum Topics in the GROUP. So the Group would show the tags of all the forum topics entered in that Group. Because there are so many forums that “cross” each other within a group, this makes good sense. A Tag Cloud of the tags listed in the forums of a Group… Any ideas? Anyone already doing this and can share? Thanks!
Looking at this codex page: https://codex.wordpress.org/Template_Tags/wp_tag_cloud Is there an easy way to use the taxonomy parameter with this? Don’t know.
Hey BP gurus… any help or thoughts on this? Thanks.
quickly looking around in the bbpress code – i don’t see any forum level tag heat maps – only for top_tags and topic_tags.
have a look at the code that powers this bbpress plugin, though it may take some reworking for buddypress
https://bbpress.org/plugins/topic/hot-tags-plus/@nuprn1 Can you post a link as to where you are using the above code that you listed so I can see how you are using it? Thanks.
for my first reply? on the topic:
http://etivite.com/groups/buddypress/forum/topic/quick-tip-disable-group-activity-status-update-post-form-for-members/#topicI was speaking to where you are using the topic tags on your site…
<?php
$ttags = bb_get_topic_tags( bp_get_the_topic_id() );
if ( $ttags ) : ?><?php printf(__(‘No tags yet.’), bp_get_forum_directory_permalink() . ‘/#tags’ ); ?>
I wanted to see how this layed out after it was styled etc.
Ok, I’ve gathered a number of sources from around the Web to come up with something that is ok… I’ll post it below. It includes a function that I gathered from bbpress.com called bb_row_tags (something hat maybe should be added to buddypress future?) and some of Rich’s code above and really is hack but it seems to almost get what I’m trying to accomplish.
@nuprn1 This is a total hack job, but it is working for me. This goes with all of my above posts. It’s my first time using pastebin, but it looked like the easiest way to show the four things I did…
It is rather odd the tags aren’t actually used in the bp-default theme.
Not-entirely-a-tangent: I wish I could mark a favorite reply from here, rather than having to find it as part of an activity stream somewhere. .oO(Am I just misunderstanding how favorites are intended to work?)
I am rather new to BuddyPress but have a question about how the forum topic tags are being displayed. The tags that appear multiple times are bigger as normal seem to be too large to fit inside the given area.
Example: http://troutpic.com/forums/
@Pisanojm , thanks heaps! It works!
- The topic ‘Displaying forum topic tags’ is closed to new replies.