Support » Plugin: IP Metaboxes » Sort WordPress Loop by the Metabox Field.

  • Resolved richyrb

    (@richyrb)


    HI,

    Using your IP Metabox Plugin i have a Metabox called ‘ipmb_metabox_4’

    and the field price is used within it.

    i wish to order the loop with price asc.

    so far i have

    query_posts(array(
    	'post_type'      => 'used',
    	'paged'          => $paged,
    	'posts_per_page' => 4,
            'order' 	 => 'ASC',
    	'orderby'        => 'meta_value',
        	'meta_key'       => 'price',
    						));

    But this doesn’t work and i assume its because IPMetabox doesn’t register the Custom Post Meta like wordpress normally does with Custom Meta Fields. Could you advise please?

    https://wordpress.org/plugins/ip-metaboxes/

Viewing 1 replies (of 1 total)
  • Plugin Author Phan Chuong

    (@pltchuong)

    Hi, it doesn’t works because your meta key was wrong. Since the metabox ID is ipmb_metabox_4 and your field is price, the meta key should be ipmb_metabox_4_price. I’m sorry I didn’t write any documentation about this, because I don’t think people want to access to the meta key directly 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Sort WordPress Loop by the Metabox Field.’ is closed to new replies.