using a magic field for orderby

39 views
Skip to first unread message

Alvar Sirlin

unread,
Mar 5, 2013, 7:01:27 PM3/5/13
to magic-...@googlegroups.com
How can this be done?

To further complicate, I need to already use meta_key for a different value:

$args = array(
   'post_type'       => array('post','page'),
   'numberposts' => 3,
   'meta_key'=>'slideshow_include_in_slideshow',
   'meta_value'=> true,
   'orderby'=>'slideshow_slideshow_order DESC'
);

thanks

Alvar Sirlin

unread,
Mar 8, 2013, 2:45:35 PM3/8/13
to magic-...@googlegroups.com
Bump.




Jason B

unread,
Mar 16, 2013, 7:54:30 PM3/16/13
to magic-...@googlegroups.com
This is a WP_Query question not a Magic Fields question.  Start here: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
Also, you to help with the multiple meta fields you should ctrl+f "multiple custom field".

Jason B

unread,
Mar 16, 2013, 8:17:21 PM3/16/13
to magic-...@googlegroups.com
To clarify, you can query multiple meta fields using 
'meta_query' => array(
array(
<meta_query_args> 
),
array(
<other_meta_query_args>
)
)

On Tuesday, March 5, 2013 7:01:27 PM UTC-5, Alvar Sirlin wrote:
Reply all
Reply to author
Forward
0 new messages