If I ever acted like I knew more than you when I was a boy. I apologize, knowing for sure I did. I don’t want my boys to follow my every action; but I wish to God I could choose the things they believe me on.
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.
The only thing I’m sure about as I start this blog… well, regarding the blog more accurately … is that the font must be like an old typewriter.
That and I really don’t want any comments.
OK, that, THAT, and I’ll only post stuff that I’m absolutely sure about…
And I’ll promise to myself that I won’t use too many ellipses…
Aw f*ck it. I’ll just blog.