• I would like my tag archive to be shown in abc order. The support I got from my theme developer said to replace this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    With this:

    <?php $tags = new WP_Query('order=ASC'); ?>
    <?php if ($tags->have_posts()) : while ($tags->have_posts()) : $tags->the_post(); ?>

    I did that, and the tags show in order. Which put the listings in ABC order, but it now shows ALL posts (tagged or not tagged) in ABC order, not just the particular tags before the change.

    Here is the full code from tag.php

    <?php get_header(); ?>
    
    			<!-- BEGIN MAIN -->
    			<div id="main">
    
    				<div class="block archive">
    
    					<h3>
    						<?php echo single_cat_title('', false); ?>
    						<span class="arrows">&raquo;</span>
    					</h3>
    
    					<?php if(category_description($category)): ?>
    					<?php echo category_description($category); ?>
    					<br /><br />
    					<?php endif; ?>
    
    					<?php $tags = new WP_Query('order=ASC'); ?>
    					<?php if ($tags->have_posts()) : while ($tags->have_posts()) : $tags->the_post(); ?>
    
    					<div id="post-<?php the_ID(); ?>" <?php post_class('block-item-big'); ?>>
    						<?php
    						if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
    							$icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
    						} else {
    							$icon = '';
    						}
    						?>
    						<?php if(has_post_thumbnail()): ?>
    						<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'widget-image'); ?>
    						<div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
    						<?php endif; ?>
    						<h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
    						<span class="block-meta">
    							<span class="heading-author"><?php the_author(); ?></span>
    							<span class="heading-date"><?php the_time('F j, Y'); ?></span>
    							<span class="heading-comments"><?php comments_popup_link('0','1','%'); ?></span>
    						</span>
    						<p><?php echo string_limit_words(get_the_excerpt(), 34); ?></p><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore"><?php _e('Read More', 'Avenue'); ?> <span class="block-arrows">&raquo;</span></a>
    					</div>
    					<?php endwhile; endif; ?>
    
    					<?php kriesi_pagination($pages = '', $range = 2); ?>
    
    				</div>
    
    			</div>
    			<!-- END MAIN -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Tag Archive – ABC Order Error’ is closed to new replies.