lundi 29 juin 2015

Wordpress issue with if condition when using it inside Loop

am using if condition inside post loop to display only post have thumbnail ,it work just fine but the loop counting the hidden posts which haven't any thumbnail and pagination also keep giving me blank page for the hidden post how can i force the loop to counting just the result of if condition posts here's my code

        <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
    'paged' => $paged,
    'post_type' => array('post','news','video'),
    );
    query_posts($args);
    while(have_posts()) : the_post(); ?>
    <?php if(has_post_thumbnail()) { ?>
       <?php echo get_the_title(); ?>
    <?php }else{} ?>
    <?php endwhile; ?>
    <?php wpbeginner_numeric_posts_nav(); ?>

Aucun commentaire:

Enregistrer un commentaire