Skip to main content
Cleanup code formatting and grammar
Source Link
Sven
  • 3.7k
  • 1
  • 34
  • 48

Take a closer look at the date parameterparameters; you'll need to enter an integer (number), not a string (text). Simply get rid of the single quotes to make it work:

$args = array(
  'post_type' => 'job',
  'tax_query' => array(  
       array(  
        'taxonomy' => 'location',
        'terms' => 'dallas',
        'field' => 'slug'
       )  
  ),
  'date_query' => array(
    array(
        'year' => 2014,
        'month' => 12
    ),
  )
); 

$jobs = new WP_Query($args);

Take a closer look at the date parameter; you'll need an integer (number), not a string (text). Simply get rid of the quotes to make it work:

$args = array(
 'post_type' => 'job',
'tax_query' => array(  
       array(  
        'taxonomy' => 'location',
        'terms' => 'dallas',
        'field' => 'slug'
       )  
 ),
 'date_query' => array(
    array(
        'year' => 2014,
        'month' => 12
    ),
  )
);
$jobs = new WP_Query($args);

Take a closer look at the date parameters; you'll need to enter an integer (number), not a string (text). Simply get rid of the single quotes to make it work:

$args = array(
  'post_type' => 'job',
  'tax_query' => array(  
    array(  
      'taxonomy' => 'location',
      'terms' => 'dallas',
      'field' => 'slug'
    )  
  ),
  'date_query' => array(
    array(
      'year' => 2014,
      'month' => 12
    ),
  )
); 

$jobs = new WP_Query($args);
Source Link
Sven
  • 3.7k
  • 1
  • 34
  • 48

Take a closer look at the date parameter; you'll need an integer (number), not a string (text). Simply get rid of the quotes to make it work:

$args = array(
 'post_type' => 'job',
'tax_query' => array(  
       array(  
        'taxonomy' => 'location',
        'terms' => 'dallas',
        'field' => 'slug'
       )  
 ),
 'date_query' => array(
    array(
        'year' => 2014,
        'month' => 12
    ),
  )
);
$jobs = new WP_Query($args);