1

Can I change the order in which connections are displayed ?

If I create say three connections and then display them at the bottom of my article, I will get them in reverse order. How can I change that ?

I tried to use 'orderby' and 'order' but it has no effect whatsoever :

$connected_titles = new WP_Query( array(
'post_type' => 'as_title',
'nopaging' => true,
'orderby' => 'title',
'order' => 'DESC',
'suppress_filters' => false,
'connected_from' => get_queried_object_id()
));
5
  • Explain connections ?
    – MartinJJ
    Commented Jun 25, 2011 at 11:47
  • This plugin is all about connections between different types of posts. I've got article posts and quote posts. One article contains (is connected to) several quotes. I want to be able to display these connected quotes in any order.
    – Mike
    Commented Jun 25, 2011 at 16:32
  • @Martin wordpress.org/extend/plugins/posts-to-posts Commented Jun 25, 2011 at 17:33
  • how are you displaying them? You should be able to use the regular query arguments for ordering, like orderby=post_title etc. Update your answer with your existing code if you can. Commented Jun 25, 2011 at 17:34
  • all right I included my code in my question
    – Mike
    Commented Jun 25, 2011 at 18:01

1 Answer 1

2

Just replace 'order' => 'DESC' with 'order' => 'ASC'.

1
  • I haven't thought about that I'm such a nut, anyway thanks scribu (and I spent like an hour creating an array to store the posts in the loop and at the end to display them in reverse order grmlgmrlmg!)
    – Mike
    Commented Jun 26, 2011 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.