Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Header title tag for wp & buddypress pages (6 posts)

Started 1 year, 11 months ago by: mistercyril

  • Profile picture of mistercyril mistercyril said 1 year, 11 months ago:

    Hello,

    I was wondering what the title tag should look like for a site running essentially on wordpress posts and pages with buddypress group, forum and member pages.

    My problem is that BuddyPress Seo doesn’t work because my header.php in my main theme file has a title tag that is pretty standard: wp_title();

    How do I get my header to call the wordpress page title or buddypress page title depending on what page the user is on? I’m guessing an “if” statement but I don’t have a clue as of how to write this…

    Any help would be great ;-)
    C.

  • Profile picture of mistercyril mistercyril said 1 year, 11 months ago:

    Is no one having trouble with BuddyPress and SEO???

  • Profile picture of Pearson Communications Pearson Communications said 1 year, 11 months ago:

    I am having the same problem too but i dont know how to fix it.

  • Profile picture of foralien foralien said 1 year, 11 months ago:

    @mistercyril Don’t know exactly would it help with BP SEO – because don’t use it myself but… I suppose that using BP special tags for head section would make sense in this case. You can check them in bp-default theme.

    In particular use following tags inside the <head> tag of header.php in your theme
    <title><?php bp_page_title() ?></title> – to generate page title
    <?php do_action( 'bp_head' ) ?> – hook to add some usefull BP head routine
    <?php wp_head(); ?> – the standard WP header hook

  • Profile picture of ervanerfian Ervan Erfian said 1 year, 11 months ago:

    Just tried:
    add_filter( ‘wp_title’, ‘bp_get_page_title’, 10, 2 );
    in your functions.php

    Hope this help..

  • Profile picture of parryjaswal Gunjan Jaswal said 1 year, 6 months ago:

    Thanks a lot ervanerfian

    adding add_filter( ‘wp_title’, ‘bp_get_page_title’, 10, 2 ); to functions.php worked for me :)