Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    For alphabetical custom fields, use [display_posts meta_key=”customfieldname” orderby=”meta_value”]

    For numerical custom fields, use [display_posts meta_key=”customfieldname” orderby=”meta_value_num”]

    Hi, I was looking for this solution.
    I have to order by a custom date field… I have tried both solutions.
    The first with meta_value = no output.
    The second doesnt´t work either. I have only three posts though the limit is 4 and one post is shown twice.
    any idea?
    Thanks.

    Thread Starter jmtmurphey

    (@jmtmurphey)

    Here is an example of how I used it and it works fine. in my case I am using a custom post type. Make sure you have the correct name for the custom field.

    [display-posts include_excerpt=”true” tag=”tatag” image_size=”tour-guide” post_type=”profile” order=”ASC” meta_key=”wpcf-last_name” orderby=”meta_value” posts_per_page=”-1″]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order By a Custom Field’ is closed to new replies.