In a plugin, I want to provide a function for users to set the default query in their templates, so they can use some custom loops. What would be the best way of doing it?
I imagine something like this:
my_plugin_set_query();
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
... iteration through a predefined post set ...
}
}