Note I sent to Fernando: Posted here for helpful reference until it becomes an option in the plugin.
Circumstances that apply – You are using custom fields to represent ordering numbers of items on a page that lists category posts.
The shortcode looks like this: [catlist id=67 thumbnail=yes thumbnail_size=thumb numberposts=8 template=product customfield_orderby=my_page_order order=asc]
The problem: Meta Values stored in the WP database are not integers. So if you were writing a custom query you could do something like ‘meta_value’ + 0 or try and assign it as an int, but in using LCP that does not work.
I hacked this today to solve for ordering by integers.
I was thinking you could add a param to shortcode_atts under
Then instead of this hack in Catlist.php
* Custom fields 'customfield_name' & 'customfield_value'
* should both be defined
if( $this->lcp_not_empty('customfield_value') ):
$args['meta_key'] = $this->params['customfield_name'];
$args['meta_value_num'] = $this->params['customfield_value'];
if ( $this->lcp_not_empty('customfield_orderby') ):
$args['orderby'] = 'meta_value_num';
$args['meta_key'] = $this->params['customfield_orderby'];
It could become an option to support both string order and numeric.
I hope you find this useful. I enjoy your plugin. Thank you.