Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to remove title prefixes ‘Topic:’ & ‘Forum:’ ?

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

  • DealL
    Participant

    @deall

    Anyone wants to say anything about it?

    Thank you 🙂

    Hi,
    You will have to look for the bbp_before_title_parse_args filter. Just an example below, but it will need tuning probably:

    function bbppc_format_titles( $new_title ){
            // Format to title only
    	$new_title['format'] = '%s';
    	return $new_title;
    
    }
    add_filter( 'bbp_before_title_parse_args', 'bbppc_format_titles' );

    Pascal.


    Robkk
    Moderator

    @robkk

    @casiepa

    That code will make it where if you visit your profile the title tag will display Your, instead of, Your Profile, Your Topics, or Your Favorites, etc.


    @deall

    Use something like this for only the single topic, and single forum pages.

    Add this php code snippet into your child themes functions.php file, or in a plugin like functionality.

     function rkk_custom_titles( $new_title ){
       if ( bbp_is_single_forum() ) {
      		$new_title['format'] = esc_attr__( '%s', 'bbpress' );
    
      	// Topic page
        } elseif ( bbp_is_single_topic() ) {
      		$new_title['format'] = esc_attr__( '%s', 'bbpress' );
    
      	}
         return $new_title;
     }
    
     add_filter( 'bbp_before_title_parse_args', 'rkk_custom_titles' );

    @Robkk
    Thanks, I just wanted to point out the filter, but as always your example is much more to the point !
    Pascal.


    DealL
    Participant

    @deall

    @casiepa thank you for the help 🙂


    @robkk
    your code has worked perfectly 🙂 thanks a lot 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar