Sorting on taxonomy page : the chalenge!
-
Hi everyone.
This is a chalenge like post because no one ever knows this :S
I thought i was doing right, this code even worked on a archive page and in a loop-somethin.php file, but in taxonomy-name.php didn’t. I’ll show you, so you see if you can help me. Any help will be appreciated.
taxonomy-cidade.php
opened by url query: alanaimoveis.com.br/cidade/matinhos/?post_type=imovel-para-venda
it shows all post (from imovel-para-venda type, assigned with CIDADE (taxonomy) matinhos)
What I need, is to order them by price (custom field wpcf-imovel-preco, created with beautifull plugin named Types)So i did this (after some research)<?php $argsvs = array( 'meta_key' => 'wpcf-imovel-preco', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => 0 ); query_posts($argsv . $query_string); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
as I said, it works beautifully on a archive page, the same code, except that I use a different kind of loop:
$loop = new WP_Query( $argsvs ); while ( $loop->have_posts() ) : $loop->the_post();
see the difference?
could you help me please?
- The topic ‘Sorting on taxonomy page : the chalenge!’ is closed to new replies.