Skip Navigation

[Closed] Post custom post type chronologically using Types date field

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 9 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#259982

I created a custom post type for a press page that mimics the blog page and I'm trying to order the page chronologically from newest to oldest.

I created a custom WP_Query to pull the press post type, but I'm not sure how to get it to order by date; I'm not sure what to use as the Types shortcode (if that's even correct). This is my code so far.

$args = array(
    'post_type' => 'press',
    'orderby' => 'date'
  );
  $press = new WP_Query( $args ); ?>
#260247

Please make sure your custom post type is using slug "press",

And try this:

$args = array(
    'post_type' => 'press',
    'orderby' => 'post_date',
    'order'=> 'DESC'
  );
  $press = new WP_Query( $args ); ?>

More help:
http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

The topic ‘[Closed] Post custom post type chronologically using Types date field’ is closed to new replies.