Skip to:
Content
Pages
Categories
Search
Top
Bottom

Grab Forum and Group Title in Theme

  • Can anyone tell me how I can grab the group and a bbpress forum title, so I can put it in a breadcrumn structure on my theme.

Viewing 1 replies (of 1 total)

  • ARHistoryHub
    Participant

    @arhistoryhub

    Here’s how the topic is added to the page title

    function bp_forums_add_forum_topic_to_page_title( $title ) {
    global $bp;
    
    if ( $bp->current_action == 'forum' && $bp->action_variables[0] == 'topic' ) {
    if ( bp_has_forum_topic_posts() ) {
    $title .= ' | ' . bp_get_the_topic_title();
    }
    }
    
    return $title;
    }
    add_filter( 'bp_page_title', 'bp_forums_add_forum_topic_to_page_title' );
    

    I’m sure you could work something out using bp_get_topic_title. Also, the current component (Groups/Members, whatever) is called to the page title with this code –

    if ( $bp->is_single_item ) {
    $title = ucwords( $bp->current_component ) . ' | ' . $bp->bp_options_title . ' | ' . $bp->bp_options_nav[$bp->current_component][$bp->current_action];

    Not sure how much this helps you, but it’s somewhere in the right direction.

Viewing 1 replies (of 1 total)
  • The topic ‘Grab Forum and Group Title in Theme’ is closed to new replies.
Skip to toolbar