• Hi
    I don’t know how to add ASC order to my category loop and also setting the number of posts (a little noob sorry)

    my category is:

    <body>
    	<div class="container wrap">
    		<main class="single-c">
    			<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    			
    				<div class="cat-product">
    					<div class="cat-thumb"><?php the_post_thumbnail('single-thumb'); ?></div>
    				</div>
    
    			<?php endwhile; ?>
    			<?php endif; ?>
    		</main>
    		<aside class="single-side">
    			<div class="side-box">
    				<?php include('ritems.php'); ?>
    			</div>
    		</aside>
    	</div>
    	<?php get_footer(); ?>
    </body> 

    help if you can

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php 
    $args = array(
        'taxonomy' => 'post_tag',
        'orderby'  => 'name', 
        'order'    => 'ASC',   
    ); 
    $terms = get_terms($args);

    For setting no of post pass posts_per_page no in post arguments.
    ?>

    • This reply was modified 7 years, 2 months ago by bcworkz. Reason: code fixed, otherwise syntax errors occur
    Thread Starter SaeedTJ

    (@saeedtj)

    thank you
    but how I should use this code?
    is it possible to give the complete code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Making Category loop order ASC’ is closed to new replies.