Hi there,
While this is interesting, it won’t be necessary.
When adding features, we have to consider if many users request for it to make the addition worth the effort as adding more code potentially makes WPSP less lightweight.
If you want to add the post view counter, you can just hook it into the WPSP loops.
If you wish to use the post view counter value, you can use its meta value for the orderby sorting with filters or shortcode.
Example/s:
Via Shortcode:
[wp_show_posts id="1477" settings="meta_key=post_views_count&orderby=meta_value_num&order=ASC"]
Via Filters:
add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
if ( 123 === $settings['list_id'] ) {
$args['meta_query'] = array(
array(
'key' => 'post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
)
);
}
return $args;
} );
-
This reply was modified 1 year, 9 months ago by
elvin.