Skip to:
Content
Pages
Categories
Search
Top
Bottom

Overriding Buddypress search with bbpress search?


  • markduffy78
    Member

    @markduffy78

    Hi,

    I hope im on the correct forum? or plugin? :-) I’d like to add conditions 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.

    Im using this solution to get global unified search.

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

    All that is remaining is to get it to search forums posts. At the moment all it does is search topics.

    –Mark

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

  • markduffy78
    Member

    @markduffy78

    is this possible?


    markduffy78
    Member

    @markduffy78

    is this possible?


    markduffy78
    Member

    @markduffy78

    Here is the 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%’;


    markduffy78
    Member

    @markduffy78

    Here is the 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%’;

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