Alternative to query_posts for main loop? [duplicate]

This question already has answers here: Closed 9 years ago. Possible Duplicate: When to use WP_query(), query_posts() and pre_get_posts I just noticed today that the documentation for query_posts() mentions some “disadvantages” of using query_posts for altering the main Loop, notably: ’causes additional SQL queries’. This seems to imply that there’s another way / a better … Read more

Upload Multiple Files With media_handle_upload

I have a WordPress form plugin and I use media_handle_upload to upload the files and get there ids directly and attached its ids to the post as a meta date, I used the following to did that: The HTML of the form field is: <input type=”file” name=”my_file_upload” id=”my_file_upload”> And the php code was: $attach_id = … Read more

numberposts? showposts? posts_per_page?

So the documentation on the Codex is pretty clear that showposts is deprecated. But that same documentation mentions nothing of numberposts. Instead, posts_per_page is listed. But if we turn to the Codex docs for get_posts we see no mention of posts_per_page, instead citing numberposts. In post.php we see what’s happening: numberposts is set up as … Read more