Happen to be looking to get the orderby a part of my query functioning for some time now, however it appears like it is only being completely overlooked.

I've got a custom area during my custom publish type known as accordion_order. It signifies the positioning it will appear inside the loop. Ie, if 1 is input, the publish is going to be towards the top of their email list, and when 1000 is joined, show at the end.

Here's my code :

$course_loop = new WP_Query( array( 'post_type' => 'post_type_name_here', 'posts_per_page' => 0, 'orderby'=> 'accordion-order', 'order' => 'desc' ) );

All help appreciated,

Regards, Dork

EDIT :::

Stackoverflow wouldn't allow me to add this being an answer, therefore if anybody could get it done for me personally and i'll election up, i'd appreciated it.

Fixed it while using following code :

$course_loop = new WP_Query( array( 'post_type' => 'post_type_name_here', 'posts_per_page' => 0, 'meta_key' => 'accordion-order', 'orderby'=> 'meta_value_number', 'order' => 'desc' ) );

Answer by Dork O Dwyer

(Fixed it while using following code) :

$course_loop = new WP_Query( array( 'post_type' => 'post_type_name_here', 'posts_per_page' => 0, 'meta_key' => 'accordion-order', 'orderby'=> 'meta_value_number', 'order' => 'desc' ) );

Should not it's such as this:

$course_loop = new WP_Query( array( 'post_type' => 'post_type_name_here', 'posts_per_page' => 0, 'meta_key' => 'accordion-order', 'orderby'=> 'meta_value', 'order' => 'desc' ) );

transformed meta_value_number to meta_value.