Add current year as an array argument?

I am trying to get WordPress to display a count of a specific post category. I can get a count with my current code, but I would like to limit the count to only those posts created during the current calendar year. My current code is:

<?php $args = array( 'cat' => 18, ); $the_query = new WP_Query( $args ); echo $the_query->found_posts; ?>

How can I add " = Current Year" as an argument in the $args array? Thanks.

Nevermind! I posted to another forum where I was given just enough of a hint to find the answer myself. If you are curious, my new code is:
<?php
$today = getdate();
$args = array(
‘cat’ => 18,
‘year’ => $today[‘year’],
);
$the_query = new WP_Query( $args );
echo $the_query->found_posts;
?>

Sponsor our Newsletter | Privacy Policy | Terms of Service