WordPress.org

Support

Support » Themes and Templates » Display posts in ascending order for a specific category only

Display posts in ascending order for a specific category only

  • I would like to display posts for a specific category in ascending order (oldest first). I have found a solution here:
    http://wordpress.org/support/topic/order-posts-by-date-ascending-in-a-particular-category?replies=4

    I am trying to apply that to my custom template:

    <?php
    /**
     * The template for displaying Category Archive pages.
     *
     * @package WordPress
     * @subpackage TravelBlogger
     * @since TravelBlogger Theme 1.0
     */
    
    get_header(); ?>
    
    	<div id="yui-main">
    	   <div class="yui-b">
    			<div class="archive-meta rounded">
    				<h1 class="page-title"><?php printf( __( '%s', 'travelblogger' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
    				<?php
    					$category_description = category_description();
    					if ( ! empty( $category_description ) )
    						echo $category_description;
    				?>
    			</div>
    			 <div id="content" class="main-content hfeed list rounded">
    					<iframe width="630" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/maps/ms?msa=0&msid=204205990435457949872.0004b92bb0bd0d6802a2d&ie=UTF8&ll=13.227728,86.776886&spn=11.077022,27.534484&t=h&z=4&output=embed"></iframe><br />
    					<?php
    
    					/* Run the loop for the category page to output the posts.
    					 * If you want to overload this in a child theme then include a file
    					 * called loop-category.php and that will be used instead.
    					 */
    					get_template_part( 'loop', 'category' );
    					?>
    
    			</div><!-- /.main-content -->
    			<?php get_sidebar('secondary'); ?>
    	   </div><!--yui-b-main-->
    	</div><!--yui-main-->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Not being a dab hand at scripting i’m not really sure how this is done. Can anyone advise me?

    Many thanks

  • The topic ‘Display posts in ascending order for a specific category only’ is closed to new replies.