Skip to:

Extracting Group Forum Topic Info for Metatags

  • antonydennis


    Hi folks…

    I have a site set up with lots of bbpress based forums, each of which belong to a Buddypress group. I want users to be able to share each forum topic on Facebook, so I need to add the og metatags to the head of the topic pages, showing topic title, content, etc.

    To do this, I need a function which can access the topic title and topic content. However, since the forums are part of groups, the topic pages appear only on group pages, where the title is the group title rather than the topic title. The content is absent from the page (the_content() returns nothing), unless I perform a loop… but that gives me two problems:
    1) get_the_content() returns me nothing, even though the_content() will output the entire page content
    2) Having done the loop before the page loads, the actual page then has no content!

    So how can I extract the topic title and topic content information in a function which I pass to add_action(‘wp_head, …) for a topic of a bbpress forum which is associated with a buddypress group?

    I am using WP 4.0.8, Buddypress 2.3.5 and bbpress 2.5.8 and you can see a link to a page I want to do this for at


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

  • djsteveb


    @antonydennis – So this is more of a “BBpress” question I guess – which has a different support group you may want to search at the bbpress forums.



    @djsteveb – yes, I thought about that… but because the forum has been associated with a Buddypress group, then it becomes a Buddypress page – so is_buddypress() returns true, bp_is_group_forum_topic() returns true, and is_bbpress() returns false… so this is very much a buddypress question!



    I have same problem. It is important for SEO e social share.


Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar