WordPress.org

Ready to get started?Download WordPress

Forums

Group by Month from custom date field (2 posts)

  1. swcomm
    Member
    Posted 2 years ago #

    Is it possible to group this query of classes by month, using the month name as a subhead?

    $args=array(
      'category__and' => array(21,25),
      'post_type' => 'classes',
      'post_status' => 'publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1,
    'meta_key'=> StartDate,
    'orderby'=>meta_value,
    'order'=> ASC
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts()

    The month name would be coming from the StartDate field. I'd like display these classes like:

    JANUARY
    Class 1
    Class 2

    FEBRUARY
    Class 3
    Class 4

    etc. Thanks for any advice.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic