• i’ld like to order my post using a custom fileds, can i do that?

    eg. field -> priority, order post by priority value
    or field -> concer_date, order showing the upcoming concerts

Viewing 3 replies - 1 through 3 (of 3 total)
  • Might need to revise the query string, but Displaying_Posts_Using_a_Custom_Select_Query, should point you in the correct direction.

    Thread Starter gighen

    (@gighen)

    i just need to modify

    ORDER BY $wpdb->postmeta.meta_value ASC

    with

    ORDER BY $wpdb->postmeta.MYPRIORITY ASC

    right?

    Thread Starter gighen

    (@gighen)

    WordPress database error: [Unknown table ‘wp_postmeta’ in order clause]
    SELECT wposts.* FROM wp_posts wposts, wp_postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = ‘tag’ AND wpostmeta.meta_value = ’email’ AND wposts.post_status = ‘publish’ AND wposts.post_type = ‘post’ AND wposts.post_date < NOW() ORDER BY wp_postmeta.prio DESC

    it doesn’t work like that ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘order by custom field’ is closed to new replies.