Simple node.js server for NITROUS.IO – I AM server

static file server

This is not anything glorious, but it will save somebody out there a couple of valuable hours of fiddling I hope. (note to future self)

https://github.com/TyrusChristiana/IAM/

2014-01-30_2230

If you haven’t tried NITROUS.io it’s pretty niceĀ https://www.nitrous.io/join/OrOOoElkTNg

 

LCP List Category Posts WP Plugin customfield_orderby hack for integer order

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
'customfield_orderby' =>'',
'customfield_orderby_isnumber' =>'',

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'];
endif;

and

if ( $this->lcp_not_empty('customfield_orderby') ):
$args['orderby'] = 'meta_value_num';
$args['meta_key'] = $this->params['customfield_orderby'];
endif;

It could become an option to support both string order and numeric.

I hope you find this useful. I enjoy your plugin. Thank you.

Until I find a better font.

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.