This is similar to another question I asked, but I can’t recognize how this query string works.
I have a custom field called “category_order” and I would like to sort my category page by this order (and not the date).
Here is my code:
<?php wp_reset_query(); ?>
<div id="content">
<div id="postFuncs">
<div id="funcStyler"><a href="#" class="switch_thumb"></a></div>
<?php if (is_category()) {
$cat_ID = get_query_var('cat'); ?>
<?php echo '<h2>'; wpzoom_breadcrumbs(); echo'</h2>'; ?><?php }
elseif (!is_category() && !is_home()) { ?>
<?php echo '<h2>'; wpzoom_breadcrumbs(); echo'</h2>'; ?>
<?php }
else { ?>
<h2>Recent Videos</h2>
<?php } ?>
</div><!-- end #postFuncs -->
<div id="archive">
<?php if (have_posts()) : ?>
<ul class="posts posts-3 grid">
<?php
$i = 0;
while (have_posts()) : the_post();
$i++;
?>
I added the
query_posts
so we can tell WordPress of a modified query to run.$query_string
will let us add onto the current parameters.orderby, meta_key, order
let us define the query by telling it how to sort the resultsMore information on ordering by parameters