I did't know that get_posts don't work with loop.php. I already have this great loop.php file and I want to use it. I created this code:
$pageposts = get_posts(
array(
'relation' => 'AND',
'post__in' => $postid,
'post_type' => 'event',
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => 'st_date',
'value' => array($todate_s, $frmdate_s),
'compare'=> 'BETWEEN',
'type' => 'DATE'
),
),
)
);
if ( have_posts() ) : ?>
<?php get_template_part('loop'); ?>
<?php else : ?>//etc
How I can convert the get_posts(//etc) to something that work with have_posts() and get_template_part('loop') at the end of my code? Is this possible?
Aucun commentaire:
Enregistrer un commentaire