WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
[resolved] Order posts in category by custom field group (3 posts)

  1. kristinjobin
    Member
    Posted 2 years ago #

    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/

  2. brucepearson
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. AmirHelzer
    Member
    Plugin Author

    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.