get_posts() with category and order parameters (2 posts)

  1. Foofy
    Posted 11 years ago #

    I needed three of the unimplemented parameters for get_posts, and got a little impatient so I added code to support them. I didn't see them in the latest alpha, and sorry if there is a plugin for this already. Anyway if anybody else wanted those parameters and is impatient like me, just replace the get_posts function in functions.php with the contents of the file below.


  2. RustIndy
    Posted 11 years ago #


    Another version of the above. The only modifications I made were to remove the $tableposts and $tablepost2cat variables (since they are being deprecated in favour of $wpdb-> and to add the update_post_caches($posts); line just ahead of the return call.

    I also named it get_posts2 so that I wouldn't need to mess with the existing get_posts routine at all, just in case the devs decide to finish writing the thing before release. My templates just call get_posts2 now instead :)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.