• Resolved Daniel

    (@dmzayasplus)


    Okay, so I am so damn close but can’t seem to cross the finish line on my own.

    Here’s what I’ve got.

    <?php
    			$count = 1;
    
    			$mostsharedposts= new WP_Query(
    				array(
    					'posts_per_page' => -1,
    					'post_type' => 'reviewer',
    					'meta_key' => 'mashsb_shares',
    					'orderby' => 'meta_value',
    					'order' => 'DESC'
    				)
    			);
    
    			while ( $mostsharedposts->have_posts() ) : $mostsharedposts->the_post();
    			$sharecount_totals = get_post_meta( get_the_ID(), 'mashsb_shares', true );
    		    ?>

    Then it lists all my custom posts, but does not order them by the meta key. A bonus, I figured out how to echo the sharecount totals as plaintext for the sake of a huge list of names.

    Any thoughts?

    https://www.ads-software.com/plugins/mashsharer/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List by sharecount for custom post type’ is closed to new replies.