• Hello,

    I will like to order a post results by custim field,

    That’s the idea
    < ?php if (have_posts()) : query_posts($query_string ."cat=-1,-53,-48-54&posts_per_page=55&orderby='tipo'&orderby='floor'&order=ASC"); ? >

    Where floor is a custom field,

    So I tried this way,
    < ?php if (have_posts()) : query_posts($query_string ."cat=-1,-53,-48-54&posts_per_page=55&orderby='".get_post_meta($post- >ID, 'floor', true)."'&order=ASC"); ? >

    and dosn’t works,

    Now I have tried something like this,
    $post = $wp_query->post;query_posts("'meta_key=fllor&cat=89,-54,-48,-53&orderby=meta_value&order=ASC;")

    Anybody knows how t do that?

    thanks,
    best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter skanthemore

    (@skanthemore)

    Thanks,
    after reading this page I found a mistake in my code,

    I had a mistake with '. Whit out this it works properly!

    $post = $wp_query->post;query_posts("meta_key=planta&cat=68,-54,-48,-53&orderby=meta_value&order=ASC&posts_per_page=55;")

    thanks,
    best regards

    Thread Starter skanthemore

    (@skanthemore)

    Well,

    Now I’m like to order in multiple custom fields,
    I’ll try now.

    Any suggestion!!??

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