• Resolved Tim Berneman

    (@tberneman)


    I’m trying to sort on a Custom Post Type (CPT) field but it’s not working. I’m using the “Custom Post Type UI” by WebDevStudios and “Advanced Custom Fields” plugin by Elliot Condon with the “Advanced Custom Fields: Date and Time Picker” by Per Soderlind. My custom field is “sale_date”. Should this work?

    [su_posts template="templates/sheriff-sales-loop.php" posts_per_page="99" post_type="sheriff_sale" order="desc" orderby="sale_date" post_status="publish"]

    Everything prints, just not in the order I want.

    https://wordpress.org/plugins/shortcodes-ultimate/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tim Berneman

    (@tberneman)

    Bump!

    Thread Starter Tim Berneman

    (@tberneman)

    I was able to figure this out. For anyone else looking to sort on a custom post type field this is the shortcode.

    [su_posts template="templates/sheriff-sales-loop.php" posts_per_page="99" post_type="sheriff_sale" order="desc" orderby="meta_value" meta_key="sale_date" post_status="publish"]

    I was able to specify all the values in the shortcode generator and preview it just fine.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sort on CPT Field in su_posts?’ is closed to new replies.