On Sep 17, 8:11 pm, "Stanley FONG" <[EMAIL PROTECTED]> wrote:
> A quick lesson to me please, not capable of having my own sql query nor to
> use API yet I'm.
>
> I wrote a little theme function to display posts either 1, 2 or 3 years ago
> (with parameters such as a time window, e.g. display posts between 1 year
> less 2 weeks to 1 year ...etc).   How do I use the lastest API to do the
> same thing?

Hi Stanley,

Posts::get() accepts 'before' and 'after' parameters. So you can do

$begin_date = HabariDateTime::date_create( foo );
$posts = Posts::get( array( 'before' => $begin_date, 'after' =>
$begin_date->modify( '+2 weeks' ) ) );

--Blake
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to