Currently my portfolio is sorting by post date and I am trying to get it to sort by alphabetical/acending order. I can not get a response from the developer so any help would be greatly appreciated. Here is my code:
[php]
<?php
// Check if a category has been assigned as Portfolio section
if( $portfolio_cat_ID ) : ?>
";
$counter = 1;
}
?>
<?php endwhile; ?>
<?php
get_footer();
[/php]
<div class="thumbsWrapper">
<?php if ( $categories ) : ?>
<div id="categoryLinks" class="grid_22">
<ul>
<li><?php esc_html_e('Categories', 'qualifire'); ?>: </li>
<?php // Generate the link to "All" categories:
if ( $current_categoryID ) : ?>
<li><a href="<?php echo the_permalink(); ?>"><?php esc_html_e('All', 'qualifire'); ?></a></li>
<?php else : ?>
<li><a href="<?php echo the_permalink(); ?>" class="current"><?php esc_html_e('All', 'qualifire'); ?></a></li>
<?php endif;
// Generate the link to the rest of categories:
foreach( $categories as $category ) :
if ( $current_categoryID == $category->cat_ID ) : ?>
<li><a href="<?php echo the_permalink().$query_string_prefix.'cat='.$category->cat_ID; ?>" class="current"><?php echo $category->cat_name; ?></a></li>
<?php else : ?>
<li><a href="<?php echo the_permalink().$query_string_prefix.'cat='.$category->cat_ID; ?>"><?php echo $category->cat_name; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div><!-- end categoryLinks -->
<?php endif; ?>
<?php
if ( !$current_categoryID )
$current_categoryID = $portfolio_cat_ID;
//adhere to paging rules
if ( get_query_var('paged') ) {
$paged = get_query_var('paged');
} elseif ( get_query_var('page') ) { // applies when this page template is used as a static homepage in WP3+
$paged = get_query_var('page');
} else {
$paged = 1;
}
// Switch the focus to the chosen portfolio category and its subcategories
query_posts( array(
'cat' => $current_categoryID,
'posts_per_page' => $portfolio_items_per_page,
'paged' => $paged
)
);
$counter = 1;
// loop
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<div class="portfolioItemWrapper">
<?php if( $portfolio_title_posistion == 'above' ): ?>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php endif; ?>
<div class="thumbHolder pngfix">
<div class="portfolioImgThumb">
<?php $thumb_url = get_post_meta($post->ID, 'thumbURL', true);
$large_image_url = get_post_meta($post->ID, 'largeImageURL', true); // Grab the preview image from the custom field 'largeImageURL', if set.
$item_description = get_post_meta($post->ID, 'itemDescription', true);
if ( !$large_image_url ) { // Check if an image is found in the post and assign it as the large preview image.
if ( function_exists('get_image_url') && findImage() ) {
$large_image_url = get_image_url();
}
}
if( $thumb_url ) { // thumbnail is provided
if ( $large_image_url ) { // if preview image is available, go ahead an link it to the thumbnail.
echo ' ';
echo '';
} else { // if preview image is NOT available, generate a thumbnail without a link
echo ' ';
echo '';
}
} elseif ( $large_image_url ) { // auto generate thumbnails
echo ' ';
echo '';
}
/* Display default image
else {
echo '';
} */
?>
</div><!-- end portfolioImgThumb -->
</div><!-- end thumbHolder -->
<?php if ( $item_description ) : ?>
<?php if( $portfolio_title_posistion == 'below' ): ?>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php endif; ?>
<div class="clear"></div>
<?php _e($item_description); ?> <?php esc_html_e('Read more...', 'qualifire'); ?>
<?php endif; ?>
</div><!-- end portfolioItemWrapper -->
<?php if ( $counter++ == 3 ) {
echo " <div id="paginationPortfolio" class="grid_21 prefix_1">
<?php //Pagination
include('scripts/pagination/wp-pagenavi.php');
if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
</div>
<?php endif;
//Reset Query
wp_reset_query(); ?>
</div>
<?php
else : ?>
<div class="grid_22 prefix_1 suffix_1">
<h2><?php esc_html_e('Portfolio section for this page has not been found!', 'qualifire'); ?></h2>
<p><?php _e("<strong>Reason:</strong> No category has been assigned as Portfolio section for this page yet. In order to fix this, go to the theme's options page and assign a category for this page.", 'qualifire'); ?></p>
</div>
<?php
endif; ?>
<?php // BEGIN the actual page content here... ?>
<div id="main-content" class="grid_21 prefix_1">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<?php if ( get_the_content() ) : ?>
<div class="entry">
<?php the_content(__('Read the rest of this page »
', 'qualifire')); wp_link_pages(array('before' => 'Pages: ', 'after' => '
', 'next_or_number' => 'number')); ?> </div>
<?php endif; ?>
</div>
<?php endwhile; endif; ?>
<div class="clear"></div>
<?php edit_post_link(esc_html__('Edit this entry.', 'qualifire'), '', '
'); ?></div><!-- end main-content -->