BuddyBoss Home – Web Support Forums Themes Boss. theme display current page title on title bar

Viewing 10 posts - 1 through 10 (of 10 total)
  • Question

    #49745
    @surfbuddy

    Hi all, How can I display the current page title to title bar instead of search bar e.g. Members, Activity, or username (if on a user’s pages). Thanks

    Answers

    #50430
    @surfbuddy

    Bump

    #50472

    Anonymous
    @

    Hi @surfbuddy, Sorry for the late response…you can add them from menu option > Appearence > Menu and can add pages there.

    Regards
    Pallavi

    #50645
    @surfbuddy

    My question is of the page “title” How can you display the title of every page, whenever a user is on that page, on the header?

    #51128
    @surfbuddy

    .bump.

    #51268

    Anonymous
    @

    Hi @surfbuddy
    You can use following code

    
    <?php global $post;
    echo get_the_title($post->ID);
    ?>
    

    Regards

    #51388
    @surfbuddy

    Thanks @vapvarun! It’s showing page title, but when it’s on a user’s bp component page (e.g. Messages), it showing the user’s name as the title. How can I get the title for bp component page (e.g. Notifications) to display?

    #51454

    Anonymous
    @

    Notification is not a real page, it’s an action screen
    You will need to echo the current action

    
    'bp_current_component()' will return you the current component you are viewing
    'bp_is_current_component( $bp->activity->slug )' will return true / false depending
    'bp_current_action()' will return the current action e.g ‘friends’
    'bp_is_current_action()' e.g ('friends')
    

    Regards
    Varun Dubey

    #51536
    @surfbuddy

    Thanks Varun! It worked.

    <?php if(!(bp_current_component())) {
           global $bp;
           echo get_the_title($post->ID); 
           } ?>
    <?php if(bp_current_component() && (!(bp_is_activity_component()))) {
          global $bp;
          echo bp_current_component(); 
          } ?>
    <?php if(bp_is_activity_component()) {
          global $bp;
          echo bp_displayed_user_username(); 
          } ?>
    #51630

    Anonymous
    @

    🙂 glad to help
    Regards
    Varun Dubey

Viewing 10 posts - 1 through 10 (of 10 total)
  • The question ‘display current page title on title bar’ is closed to new replies.