Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ben Cole

    (@bcole808)

    Hello!

    This feature is not built into the plugin yet, but I will see if I can add it in a future version. Is there anything else that you would want to display in a sidebar widget other than the top 5 posts based on social score?

    The social data is stored as custom post meta, so if you know how to write your own sidebar widgets then it is possible to write a query which selects the top posts based on social score. Here is how you would write the query:

    $args = array(
        'order' => 'DESC',
        'orderby' => 'meta_value_num',
        'meta_key' => 'socialcount_TOTAL',
        'post_status' => 'publish',
        'post_type' => 'post'
    );
    
    $wp_query = new WP_Query( $args );
    
    if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : 
    
    	$wp_query->the_post(); 
    
    	// DISPLAY POST HERE
    
    endwhile;
    endif;

    More documentation on how to write custom functionality for this plugin can be found on the Github page here: https://github.com/chapmanu/wp-social-metrics-tracker

    A widget with top5(to10)-posts from the actual day and the last day would be really great. Anyway I’m very happy that I found this plugin! Keep on!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘show posts in sidebar based on social score’ is closed to new replies.