• Resolved thomas

    (@beloutte)


    hello

    I dont understand why I can’t manage to sort my posts…
    here is my query, I have a custom post type “produit” and 2 custom taxonomies “type-produit” and “secteur”
    Here I try to sort one kind of “type-produit”

    thanks

    $myquery['tax_query'] = array(
    	array(
    		'taxonomy' => 'type-produit',
    		'terms' => 'stores-exterieurs-mobiles',
    		'field' => 'slug',
    		),
    	'order' => 'DESC'
    	);
    query_posts($myquery);
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    The default ‘order’ is ‘DESC’. See the orderby parameters if you want to order by something different than ”date’ (default):
    http://codex.ww.wp.xz.cn/Function_Reference/WP_Query#Order_.26_Orderby_Parameters
    Example ordering by title:

    $args = array(
    	'order' => 'ASC',
    	'orderby' => 'title',
    	'tax_query' => array(
    		array(
    			'taxonomy' => 'type-produit',
    			'terms' => 'stores-exterieurs-mobiles',
    			'field' => 'slug',
    		),
    	),
    );
    query_posts($args);

    Thread Starter thomas

    (@beloutte)

    thanks a lot for your answer !
    it’s strange, I thought I tried this syntax… :/
    anyway thank you very much 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘custom taxonomy post order’ is closed to new replies.