Home Forums WTI Like Post PRO Post grid assorted by meta data Reply To: Post grid assorted by meta data

#601
Webtechideas
Keymaster

Can you please explain a bit more when you say “it is not working properly”? It’s quite difficult to understand as there is not enough information.

– Were you previously using the lite version and now have started using the pro version?
> If this is the case, then you might already have some posts in your system which do not have the meta data for the like count. So go to our plugin setting page end section where you will find the button which says “Update Like Meta”. Hit this button and it will add the necessary like data to post meta field.

– Have you created the widget or that comes from the theme?
> We are not sure about the widget code. The like meta data contains numeric value. So the standard order by will not work. It has to be 'orderby' => 'meta_value_num'. The basic query for such numeric sorting looks like below.

new WP_Query(
	array(
		'post_type' => 'post',
		'posts_per_page' => get_option('posts_per_page'),
		'paged' => 1,
		'meta_key' => '_wti_like_count',
		'orderby' => 'meta_value_num',
		'order' => 'DESC'
	)
);

Please check and let us know.

Thanks