Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display Forum Topics where Forum Posts contain keywords

  • Hi,

    I’d like to add condtions to the bp_forum_topics() loop that only contain posts with certain keywords. Can anyone help me with this?

    I’d like to create a custom plugin that overrides the current function bp_forum_topics() that does this. Im new to wordpress development so unsure about filters and tags. Right now it returns all topics (with the exception of loose search terms, newest, popular etc). I want to be able to return topics if the posts related to that topics contains specific search terms.

    –Mark

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

  • pcwriter
    Participant

    @pcwriter

    @markaduffy

    Take a look at Brajesh’s Global Search. It has functions to return search results for forums, blogs, members, groups and site pages/posts.

    Creating The sitewide global/unified search Page for your Buddypress Theme

    @pcwriter

    Yeah, ive actually implemented that already, but it just searches the forum topic.

    Brajesh says

    Hi Mark,
    Thanks for the comment. As far as I see buddypress provides no way for searching/listing forum posts on search page. So, In my guess, It’s not going to be easy. Though, If you are familiar with bbpress you can override buddypress forum search and make it happen .

    SQL: SELECT
    post.post_id,
    post.topic_id,
    topic.topic_title,
    post.post_text
    FROM bb_posts post
    LEFT JOIN bb_topics topic
    ON topic.topic_id = post.topic_id
    WHERE topic_title LIKE ‘%searchterms%’ OR post_text LIKE ‘%searchterms%’;

    updated. added SQL.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Forum Topics where Forum Posts contain keywords’ is closed to new replies.
Skip to toolbar