Skip to:
Content
Pages
Categories
Search
Top
Bottom

This forum is empty

  • @chrtravels

    Participant

    Hi all,

    This may be a basic question but I haven’t found an answer in the search.

    If I create a group category and forums underneath that, you cannot assign a category to a buddypress group.

    However I can make the parent category a forum instead. This will then allow you to assign this to a group and see the categories underneath. It looks messy though because when you click on the parent forum it says “this forum is empty.” Though it does let you see the categories below this message.

    Is there a way to just remove the “this forum is empty message? I don’t want it to say this underneath every parent forum.

    Thanks much,
    Chris

Viewing 10 replies - 1 through 10 (of 10 total)
  • @robin-w

    Moderator

    do you know how to add something to your childtheme functions file ?

    @chrtravels

    Participant

    Hi Robin,

    In functions.php? I do know how to enter code there, via ftp or cPanel. I just don’t know what code to enter to solve for this. 🙂

    Chris

    @robin-w

    Moderator

    great

    than add this

    //This function changes the text wherever it is quoted
    function rew_change_translate_text( $translated_text ) {
    	if ( $translated_text == 'This forum is empty.' ) {
    	$translated_text = 'new text';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'rew_change_translate_text', 20 );

    Instead of ‘This forum is empty.’ you will get ‘new text’, so just change new text to what you want

    eg change the line

    $translated_text = 'new text';

    to

    $translated_text = 'Categories listed below';

    – if you want it blank then have that line say

    $translated_text = '';

    @chrtravels

    Participant

    Thanks much. that worked. 🙂

    Is there no way to remove that element all together? Or at least if I knew which
    CSS file this is formatted in, I could play around with the spacing. That text takes
    up quite a bit of space at the top of the forum and pushes everything down further than
    I would like.

    I am pretty good as user the inspector to identify areas to change but I have a heack of a time determine which css file is involved.

    Thanks again for your help!

    Chris

    @robin-w

    Moderator

    if you have a child theme, and are happy with ftp, I can give you a revised template

    @chrtravels

    Participant

    sure that would be great. Thanks 🙂

    @robin-w

    Moderator

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/content-single-forum.php
    bbPress will now use this template instead of the original
    and you can amend this

    so change line 26 from

    <?php bbp_single_forum_description(); ?>

    to

    <?php if (bbp_get_single_forum_description != 'This forum is empty.') bbp_single_forum_description(); ?>

    @chrtravels

    Participant

    Thanks, I’ll give this a try and let you know how it goes.

    @gkldh

    Participant

    hello how can i add link on text ??

    if ( $translated_text == 'This forum is empty.' ) {
    	$translated_text = 'new text';
    }

    @robin-w

    Moderator
    add_filter( 'gettext', 'rew_translations', 20 , 3 );
    
    function rew_translations( $translated, $text, $domain ) {
    	if ($domain != 'bbpress' return $translated;
    	if ( $translated == 'This forum is empty.' ) {
    		$translated = 'new text';
    	}
    	return $translated;
    }
Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar