Skip to main content
left out double arrow
Source Link
goldenapples
  • 9.3k
  • 2
  • 33
  • 39

You'd have to specify day, month, and year to get today's posts:

$my_query = new WP_Query( array(
    'cat'=>1,
    'year'=>date('Y'),
    'monthnum'=>date('m'),
    'day'=date'day'=>date('d'),
    'posts_per_page'=>-1 ) );

Leaving day blank just doesn't set that query var, so its not restricting your query at all.

You'd have to specify day, month, and year to get today's posts:

$my_query = new WP_Query( array(
    'cat'=>1,
    'year'=>date('Y'),
    'monthnum'=>date('m'),
    'day'=date('d'),
    'posts_per_page'=>-1 ) );

Leaving day blank just doesn't set that query var, so its not restricting your query at all.

You'd have to specify day, month, and year to get today's posts:

$my_query = new WP_Query( array(
    'cat'=>1,
    'year'=>date('Y'),
    'monthnum'=>date('m'),
    'day'=>date('d'),
    'posts_per_page'=>-1 ) );

Leaving day blank just doesn't set that query var, so its not restricting your query at all.

Source Link
goldenapples
  • 9.3k
  • 2
  • 33
  • 39

You'd have to specify day, month, and year to get today's posts:

$my_query = new WP_Query( array(
    'cat'=>1,
    'year'=>date('Y'),
    'monthnum'=>date('m'),
    'day'=date('d'),
    'posts_per_page'=>-1 ) );

Leaving day blank just doesn't set that query var, so its not restricting your query at all.