php - Debugging Wordpress Loops -


specifically in buddypress forums loop.

i want able alter sql returns specific forums topics. want able find sql executed specific loop. might stumble upon on it, wonder if there way trace / debug , loops find sql generated.

i'm still struggling understand loops , tags, actions , hooks. tips debugging helpful.

update: tell want exactly. want able return forum topics in buddypress forums meet conditions ie want return forum topics contain search terms in topics posts. best way add conditions forums loop sql.

thanks

if realy whant use sql open wp-includes/query.php , go functin get_posts. rather big function magic happens. not modify here use see witch filters called , when ( eg. @ line 1869 you'll see $search = apply_filters_ref_array('posts_search', array( $search, &$this ) ); , witch means need filter on hook posts_search, , can modify sql query, example pick right filters ).

now , if you're stating out easyer , better practice use query_posts function right before loop starts. loop usualy starts in you're theme files ( search codex.wordpress.org available theme files, find them , witch 1 called , when ) .


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -