Skip to main content
Commonmark migration
Source Link

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => date('Y-m-d'),
        'compare' => '>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

Reference

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => date('Y-m-d'),
        'compare' => '>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => date('Y-m-d'),
        'compare' => '>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

Reference

http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => date('Y-m-d'),
        'compare' => '>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctlya machine can parse correctly.

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => date('Y-m-d'),
        'compare' => '>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => date('Y-m-d'),
        'compare' => '>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

deleted 13 characters in body
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => arraydate($date1, $date2'Y-m-d'),
        'compare' => 'BETWEEN''>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => array($date1, $date2),
        'compare' => 'BETWEEN',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

It sounds like you need a meta_query.

$query = new WP_Query ( 
  array( 
    'paged' => $paged, 
    'post_type' => 'event', 
    'posts_per_page' => 4,
    'meta_query' => array(
      array(
        'key' => 'date_key_name',
        'value' => date('Y-m-d'),
        'compare' => '>=',
      )
    )
  )
);

Be aware that your dates need to be in some format that a machine can parse correctly.

##Reference http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174
Loading