Support » Plugin: Post Views Count (Support caching plugins!) » How To Sort Most/Least Viewed Posts in List

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Julio Potier

    (@juliobox)

    Yes of course, do this :

    $orderby = $_GET['v_orderby']=='asc' ? 'asc' : 'desc';
    echo do_shortcode( "[most_views order=$orderby]" );

    hi dont really know what to do with that, i am using a dropdown filter for the functions to sort the posts, this is the sort option for views i have now

    <?php if(preg_match('/v_sortby=views&v_orderby=desc/', $page_url)) {
    				_e('Views (Most)', 'gp_lang');} ?>

    <option value="<?php echo $review_url; ?>v_sortby=views&v_orderby=desc"><?php _e('Views (Most)', 'gp_lang'); ?></option>

    Plugin Author Julio Potier

    (@juliobox)

    Can you paste me all the code of this page via pastebin.com ? Thank you

    Yes sure, Thanks

    Plugin Author Julio Potier

    (@juliobox)

    Ok but not enought, where is my shortcode ? where is the code which displays all posts ?
    Thanks

    not sure what you mean, the review-list.php displays all the posts

    Plugin Author Julio Potier

    (@juliobox)

    Damn, this is a big mess :/
    Who coded this ? This ocde is using a preg_match instead of a simple $_GET array, WTF ?
    Sorry, i can’t fix it this time, too timeeater for me.

    “Resolved”

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How To Sort Most/Least Viewed Posts in List’ is closed to new replies.