Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3932924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:32:37+00:00 2026-05-19T23:32:37+00:00

Specifically in the buddypress forums loop. I want to be able to alter the

  • 0

Specifically in the buddypress forums loop.

I want to be able to alter the SQL so that it returns only specific forums topics. I want to be able to find where the SQL is executed for a specific loop. I might stumble upon on it, but wonder if there is a good way to trace back / debug any and all loops to find the SQL that is generated.

I’m still struggling to understand loops and tags, actions and hooks. So any tips for debugging would be really helpful.

UPDATE:
I tell you what I want to do exactly. I want to be able to return forum topics in buddypress forums that meet certain conditions ie I want to return certain forum topics that contain search terms in that topics posts. What is the best way to add those conditions to the forums loop sql.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T23:32:38+00:00Added an answer on May 19, 2026 at 11:32 pm

    If you realy whant to use sql then open up wp-includes/query.php , go to functin get_posts. This is a rather big function where all the magic happens. Do not modify anything here but use it to see witch filters are called and when ( eg. at line 1869 you’ll see $search = apply_filters_ref_array('posts_search', array( $search, &$this ) ); , witch means you need an filter on the hook posts_search, and then you can modify the sql query, this is just an example pick the right filters ).

    Now , if you’re just stating out it would be easyer and a better practice to use query_posts function right before the loop starts. The loop usualy starts in you’re theme files ( search codex.wordpress.org for available theme files, where to find them and witch one is called and when ) .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Specifically, in VS 2008, I want to connect to a data source that you
Specifically, I want to write a powershell script to find every file with extensions.lib
Specifically I have a PHP command-line script that at a certain point requires input
Specifically, I have a model that has a field like this pub_date = models.DateField(date
Specifically I am looking for a good OOP PHP CURL class that can be
Specifically for Twisted, I would like to be able to determine whether the server
I want to specifically run the default Android browser for a given URL. I'm
I'm talking specifically about the public, private and protected keywords that can apply to
Specifically, I want my New menu item to respond to both Cmd+N and Cmd+T
Specifically, I want to add an spatial index in a multi_polygon column. This works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.