Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » Order posts in category by custom field group

  • Resolved kristinjobin

    (@kristinjobin)


    Hi,

    Just downloaded this plugin for the specific purpose of ordering posts in the category of events by the date the occur, not the date they are posted. How can I do this? I created a custom field group called date but i’m not quite sure where to go from here.

    I also added this to my archive.php

    <div id=”content” style=”<?php echo $content_css; ?>”>
    <?php if(is_category(’33’)){
    query_posts(‘meta_key=date&orderby=meta_value&order=ASC’);
    }
    ?>

    http://wordpress.org/extend/plugins/types/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author brucepearson

    (@brucepearson)

    Types usually stores the field with a wpcf- prefix. You may need something like:

    query_posts(‘meta_key=wpcf-date&orderby=meta_value_num&order=ASC’);

    Also use orderby meta_value_num to ensure they are sorted numerically.

    Plugin Author Amir Helzer

    (@amirhelzer)

    Bruce’s answer should make this work. Please let us know if you need any more help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order posts in category by custom field group’ is closed to new replies.