Changing Wordpress post order with URL string


Staff member
I am trying to add a dropdown to sort my custom posts.

I have tried the solutions here - <a href="" rel="nofollow"></a> - and here - <a href="" rel="nofollow"></a>

I can’t get either of these to work and I can’t even get my posts to sort by adding this to the end of my URL - ?orderby=title&amp;order=DESC.

Out of curiosity, I went over to DigWP and tried this - <a href=";order=DESC" rel="nofollow">;order=DESC</a> which worked and sorts the posts by title and in descending order.
So I am wondering why it won’t work on my site? Here is the code that is getting my posts.

&lt;?php   $my_query = new WP_Query( array( 
                        'post_type' =&gt; 'project',
                        'post_status' =&gt; 'publish',
                        'paged' =&gt; get_query_var('paged'),
                while ( $my_query-&gt;have_posts() ) : $my_query-&gt;the_post(); ?&gt;

I'm guessing there is something wrong with the query or perhaps wp_query won't allow ordering posts in this way?
Any help appreciated.