Viewing 1 replies (of 1 total)
  • Thread Starter alam7o

    (@alam7o)

    sorry for update post my query in custom template php is

    <?php 
    
      $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    
      $custom_args = array(
          'post_type' => 'post',
    	  'orderby' => 'date',
    	  'cat' => array('5','1'),
          'posts_per_page' => 5,
          'paged' => $paged
        );
    
      $custom_query = new WP_Query( $custom_args ); ?>
    
      <?php if ( $custom_query->have_posts() ) : ?>
    
        <!-- the loop -->
        <?php while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?>
          <article class="loop">
            <h3><?php the_title(); ?></h3>
            <div class="content">
              <?php the_excerpt(); ?>
            </div>
          </article>
        <?php endwhile; ?>
        <!-- end of the loop -->
    
        <!-- pagination here -->
        <?php
          if (function_exists(custom_pagination)) {
            custom_pagination($custom_query->max_num_pages,"",$paged);
          }
        ?>
    
      <?php wp_reset_postdata(); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘use Sort Highest/Lowest Rated Posts in custom page template’ is closed to new replies.