Viewing 3 replies - 1 through 3 (of 3 total)
  • Could you use the orderby=meta_value clause with query_posts?

    Plugin Author scribu

    (@scribu)

    After you’ve registered the DateStart custom field:

    function my_queryable_custom_fields() {
        register_queryable_custom_field( 'DateStart' );
    }
    add_action('init', 'define_queryable_custom_fields');

    You can just go to this URL:

    /category/some-category/?orderby=DateStart

    and it should display sorted posts, even if they don’t have a DateStart custom field.

    Hi Scribu,

    First of all, thanks for all the work on WP.
    In the above example, shouldn’t the add_action be like:
    add_action('init', 'my_queryable_custom_fields'); instead of define?

    I am looking forward to future versions of the plugin.

    @npsites: if you only need to sort by ONE custom field than orderby=meta_value can be used without trouble as MichaelH already stated.

    Good luck!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Query Custom Fields] hey scribu I still need to sort by Custom Fields can you help?’ is closed to new replies.