1. Home
  2. Docs
  3. Responsive Posts Carousel
  4. FAQs
  5. Order or Sorting

Order or Sorting

You can sort the slider items as you like by providing order and orderby attributes in the shortcode.

order Attribute

You can use the following values for order attribute

  • DESC – Descending order of orderby attribute
  • ASC – Ascending order of orderby attribute

orderby Attribute

You can use the following values for orderby attribute

  • date – Sort by post published date
  • ID – Sort by post ID
  • author – Sort by post author
  • title – Sort by post title
  • modified – Sort by post modify date
  • rand – Random order
  • meta_value – If you’re using meta_key attribute for sorting
  • meta_value_num – If the meta_key is an integer

meta_key Attribute

If you want to sort your slider items by some custom meta, provide the meta key name using this attribute. Suppose if there is a meta key named purchased_date and you want to sort the items by this, you will use the following attributes in your shortcode

meta_key="purchased_date" orderby="meta_value"

So your shortcode will become

[wcp-carousel id="1609" order="DESC" orderby="meta_value" meta_key="purchased_date"]

Drag Posts Titles to Sort

Since version 13.6, you can drag the post titles and change their orders directly from the selection menu as displayed below.

After setting the order above, you have to set the orderby attribute of the shortcode to post__in as shown in the following example.

[wcp-carousel id="1609" orderby="post__in"]