Arrange Posts by Custom Fields
-
Hi everyone, I’d like to ask for help on arranging Posts by custom fields in category.php.
I’m trying to sort certain categories’ posts by price which are added via custom field “price”. I.E. High price and Low Price.
This is the query that my theme does at the moment:
<?php $x = 0; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; if($paged > 1) $y = (0 + (($paged-1) * 12)); else $y = 0; global $wp_query; $args = array_merge( $wp_query->query, array( 'posts_per_page' => 12 ) ); query_posts( $args ); while (have_posts()) : the_post(); ?>Thank you so much for your help guys!
The topic ‘Arrange Posts by Custom Fields’ is closed to new replies.