WordPress.org

Forums

Extending query_posts (2 posts)

  1. delaque
    Member
    Posted 9 years ago #

    I've tried to use a few plugins for displaying random posts on my page, but none of them seem to use the Loop, which seems like the "right" way of doing it from where I'm standing.

    I have no real experience with building plugins for WP, so I figured this might be a good test run for me. It seems to me that the way to do this would be to use a hook right before the SQL query is sent to the server, and modify the query based on the randomizing logic. Does this seem like the right approach? Is there a hook just before the SQL query is posted to the server? Which one?

    Alternatively, is there another way to create a new function to instigate the Loop? How do I create a new wp_query without the query_posts function? And am I being overzealous? Is there an easier way, that feels less of a hack, and more of an extension?

  2. Kafkaesqui

    Posted 9 years ago #

    Great questions, and ones that would be nice to have the answers to. But I'd suggest joining the wp-hackers mailing list and asking them there, as you'll find a far greater developer 2 inquiry ratio than here, especially for the level of knowledge needed for WordPress internals of this sort.

    http://lists.automattic.com/mailman/listinfo/wp-hackers

Topic Closed

This topic has been closed to new replies.

About this Topic