WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Change "topic" to something else?

[Resolved] Change "topic" to something else?

Viewing 2 replies - 1 through 2 (of 2 total)
  • OK, so after some research, I think I figured this out. You need to add one line of code to the plugin and a few more to functions.php.

    Here’s what I added into functions.php:

    function my_tag_text_callback( $count ) {
    	//This function is used to replace the "topic" with "club" for the tag cloud. When you hover mouse over a tag value, it
    	//would normally say "1 topic". Now it will say "1 club".
     return sprintf( _n('%s Club', '%s Clubs', $count), number_format_i18n( $count ) );
    }

    Note: You could of course use “Group” and “Groups” like this:
    return sprintf( _n('%s Group', '%s Groups', $count), number_format_i18n( $count ) );

    Now, in the bp-group-tags.php file, go to line 260 and change it from this:
    'separator' => ' '

    to this:
    'separator' => ' ', //add a comma at the end

    Then on a new line just below 260 add the following:
    'topic_count_text_callback' => 'my_tag_text_callback'

    So you end up with lines 260 and 261 looking like this:

    'separator' => ' ',
      'topic_count_text_callback' => 'my_tag_text_callback'

    This change was based on the information found here:
    http://codex.wordpress.org/Function_Reference/wp_tag_cloud#Change_Title_Text_of_Cloud_Links

    Cheers,
    Jeff

    Hi Jeff,

    Thanks for this. Working perfect.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Change "topic" to something else?’ is closed to new replies.