Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP – bbP – WordPress SEO integration


  • SydneyDesigner
    Participant

    @sydneydesigner

    To all those smart coding guys out there, please can someone help me with the bbP functions needed to complete the code below. I think there are two bbP functions needed – see square brackets [??...]. Or maybe someone has a better way of doing it.

    I’m trying to integrate BP1.6.1, the new bbP2.2.2 forums and WordPress SEO1.3.1.1 so that the WordPress SEO (meta) page titles are shown when a bbP Topic is being shown within a BP page (just like they are shown for native bbP forum pages).

    I’ve hooked functions into ‘bp_modify_page_title’ before and managed to extract ‘_yoast_wpseo_title’ before. So I’m part way there I guess.

    I also understand that I need to change the priority from 10 to 16 (or more) in line below (in buddypress>bp-core>bp-core-filters.php), to make bp_modify_page_title filter execute after, and hence overrule, WPSEO title which has priority 15 (in worpress-seo>frontend>class-frontend.php).
    add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 );


    add_filter( 'bp_modify_page_title', 'new_page_title', 10, 4 );
    function new_page_title( $new_page_title, $title, $sep, $seplocation ) {
    global $bp, $bbp;
    /** If bbP Topic is being shown within a BP page then replace title with title input via Yoast WordPress SEO plugin */
    if ( [?? a bbp function that is true when bbP Topic is being shown within a BP page] && bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) ) {
    [?? a bbp function that loads the bbP Topic Post ID to $topic->ID];
    $new_page_title= get_post_meta( $topic->ID, _yoast_wpseo_title, true);
    }
    return $new_page_title;
    }

    If you can help please, and I can then get this to work, I’ll post the result back again so others can benefit.

    Many thanks.

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

  • SydneyDesigner
    Participant

    @sydneydesigner

    Can anyone help with this please?

    1. What is the bbp function that gives me the bbP Topic Post ID for the bbP topic that is currently being shown within a Buddypress group page.

    2. What is bbp function that returns value true when a bbP Topic is currently being shown within a BuddyPress group page?

    Thanks in advance.


    SydneyDesigner
    Participant

    @sydneydesigner

    Please can someone help with answers to the couple of questions above. I think you would be helping a lot of people if we can figure out a good way to integrate WordPress SEO with the BBPress forums used within BuddyPress.

    If you can help please, and I can then get this to work, I’ll post the result back again so others can benefit.

    Many thanks.

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

You must be logged in to reply to this topic.