1

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....

  ?>
2

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();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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