Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

At this current moment. is it possible to sort multiple custom post/page types without a meta key/value?

I'm looking to just sort the posts by page attribute order:

enter image description here

What have i done so far? I've created a query like so and no luck

  <?php
  // query for videos in the home page category
  $args = array(
   'post_type' =>array('videos', 'podcasts'), 
   'category_name' => 'Videos on Homepage', 
   'post_per_page' => 4,
   'order' => 'DESC'
   );
  $loop = new WP_Query($args);
  // etc....

  ?>
share|improve this question

1 Answer 1

What ended up working is adding the array key, "orderby" and adding menu_order:

  <?php
  // query for vidoes in the home page category
  $args = array(
   'post_type' =>array('videos', 'podcasts'), 
   'category_name' => 'Videos on Homepage', 
   'post_per_page' => 4,
   'order' => 'DESC',
   'orderby' => 'menu_order',
   );
  $loop = new WP_Query($args);

  // start loop for first set of videos
  while($loop->have_posts()) : $loop->the_post();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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