• I’d like to order all the posts listed on my category.php page alphabetically.

    Here is the code on my category.php page:

    <?php
    /**
     * The template for displaying Category Archive pages.
     */
    
    get_header(); ?>
    <?php global $q_config; ?>
    
    			<div id="product_gallery" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
     			 <?php 	//This checks what language qTranslate has selected and returns the appropriate ShortDesc
    					if (ppqtrans_getLanguage() =="en") {
    					   $key = "byline_en";
    					   $description = get_post_meta($post->ID, $key, true);
    					}
    					if (ppqtrans_getLanguage() =="fr") {
    					   $key = "byline_fr";
    					   $description = get_post_meta($post->ID, $key, true);
    					}
    				?>
    
    			<div class="product_thumbnail">
    			<a href="<?php the_permalink() ?>">
    			<?php //the_post_thumbnail grabs the post's "featured image" this feature has added theme support in the child theme functions.php ?>
    			<?php the_post_thumbnail('thumbnail', array('class' => 'thumbnail')); ?>
    			</a>
    
    			<?php //This piece of code figures out the corrosponding post_title of the featured image ?>
    			<h1 class="post_caption"><?php the_title(); ?></h1>
    			<p><?php echo $description; ?></p>
    			</div> <!-- product_thumbnail -->
    
    			<?php endwhile; // end of the loop. ?>
    
    			<div class="clear"></div>
    
    </div><!-- #content -->
    
    <?php get_footer(); ?>

    What do you think the best way to go about that would be?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Order Category Posts’ is closed to new replies.