bbdev

Yoast SEO - Buddypress template titles

Jun 7th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2. if( !function_exists( 'buddyboss_wpseo_fix_title_buddypress' ) ):
  3. function buddyboss_wpseo_fix_title_buddypress($title) {
  4.     if ( function_exists( 'buddypress') && ( !empty( buddypress()->displayed_user->id ) || !empty( buddypress()->current_component ) ) ) {
  5.         $bp_title_parts = bp_modify_document_title_parts();
  6.  
  7.         // let's rebuild the title here
  8.         $title = $bp_title_parts['title'] . ' ' . $title;
  9.     }
  10.     return $title;
  11. }
  12. add_filter( 'wpseo_title', 'buddyboss_wpseo_fix_title_buddypress' );
  13. endif;
Add Comment
Please, Sign In to add comment