Skip to main content

I need someone to answer this question. I have metabox which shows date:

 $date     = rwmb_meta( 'pb_match_date', '', $post->ID );

I want to get all the associated posts with specific date of that metabox as follows.
:

23 Oct 16:
 
1)Post 1
2)Post 2

  1. Post 1
  2. Post 2

27 Oct 16:
 
1)Post 1
2)Post 2
3)Post3
What

  1. Post 1
  2. Post 2
  3. Post 3

What will be the query?

$args = array(
        'post_type' => array( 'post' ), 
        
   );
       
$my_query = null;
    $my_query = new WP_Query($args); ?>
<?php  while ($my_query->have_posts()) : $my_query->the_post(); 
 $dates    $dates = rwmb_meta( 'pb_match_date','', $post->ID);
    foreach ($$dates $dates as $date ) { 
 
        //Is it corectcorrect? If not then what is the way?

}
?>
<?php  endwhile; ?>
   <?php }
endwhile;
wp_reset_postdata(); ?>

I need someone to answer this question. I have metabox which shows date:

 $date     = rwmb_meta( 'pb_match_date','', $post->ID);

I want to get all the associated posts with specific date of that metabox as follows.
23 Oct 16:
 
1)Post 1
2)Post 2
27 Oct 16:
 
1)Post 1
2)Post 2
3)Post3
What will be the query?

$args = array(
        'post_type' => array( 'post' ), 
        
   );
      $my_query = null;
    $my_query = new WP_Query($args); ?>
<?php  while ($my_query->have_posts()) : $my_query->the_post(); 
 $dates     = rwmb_meta( 'pb_match_date','', $post->ID);
foreach ($$dates as $date ) { 
 
 //Is it corect?If not then what is the way?

}
?>
<?php  endwhile; ?>
   <?php wp_reset_postdata(); ?>

I need someone to answer this question. I have metabox which shows date:

 $date = rwmb_meta( 'pb_match_date', '', $post->ID );

I want to get all the associated posts with specific date of that metabox as follows:

23 Oct 16:

  1. Post 1
  2. Post 2

27 Oct 16:

  1. Post 1
  2. Post 2
  3. Post 3

What will be the query?

$args = array(
    'post_type' => array( 'post' )        
);
 
$my_query = null;
$my_query = new WP_Query($args);
while ($my_query->have_posts()) : $my_query->the_post(); 
    $dates = rwmb_meta( 'pb_match_date','', $post->ID);
    foreach ( $dates as $date ) { 
        //Is it correct? If not then what is the way?
    }
endwhile;
wp_reset_postdata(); ?>
Source Link
bdtheme
  • 145
  • 2
  • 3
  • 14

How to show all the associated posts with specific date of data metabox?

I need someone to answer this question. I have metabox which shows date:

 $date     = rwmb_meta( 'pb_match_date','', $post->ID);

I want to get all the associated posts with specific date of that metabox as follows.
23 Oct 16:
1)Post 1
2)Post 2
27 Oct 16:
1)Post 1
2)Post 2
3)Post3
What will be the query?

$args = array(
        'post_type' => array( 'post' ), 
        
   );
      $my_query = null;
    $my_query = new WP_Query($args); ?>
<?php  while ($my_query->have_posts()) : $my_query->the_post(); 
 $dates     = rwmb_meta( 'pb_match_date','', $post->ID);
foreach ($$dates as $date ) { 

 //Is it corect?If not then what is the way?

}
?>
<?php  endwhile; ?>
   <?php wp_reset_postdata(); ?>