Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In one of my form input, the options are a list of posts. I can use the loop to get the posts, but, getting things from database table is faster, right? I see plugins sometimes use db directly, sometimes use loop. I'm confused.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

In general I try to avoid custom SQL queries as much as i can and use the native WordPress functions but in some cases its much better/faster to use custom queries.

if the case is just get a list of posts the you can use the WP_Query or get_posts which will work almost as fast as a custom query (as long as you don't need some advan

share|improve this answer
    
I see, thanks! I hate the freedom :-)) –  Jenny Feb 27 '12 at 11:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.