Answers for "wordpress fetch all comment which has the post query"

0

wordpress fetch all comment which has the post query

//this is for post query with default paggination and 

//post with comment only 

  <?php
    $paged = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1;
    query_posts( 
        array ( 
             'comment_count' => array(
                    'value'   => 1,
                    'compare' => '>=',
                ),
            'post_type' => 'gallery',
            'posts_per_page' => 10,
            'paged' => $paged ) 
        );      
        // The Loop
        while ( have_posts() ) : the_post();
          ?>
          
          
          the_post_thumbnail() ;
          etc etc
          here you can call anyting you want 
          
          
          
          
          <?php
        endwhile; 
       the_posts_pagination( array( 'mid_size'  => 2 ) );
        // Reset Query
        wp_reset_query();
     ?>
Posted by: Guest on July-16-2021

Code answers related to "wordpress fetch all comment which has the post query"

Browse Popular Code Answers by Language