Sort by Votes

Hello, I have a template which sorts my custom post types with this filters: All, Reviews and Rating. But i want to order them by VOTES, im using your plugin. The code in the template file its something like this:

<ul class=”sort_by”>

<li class=”title”> <?php echo SORT_BY;?>

<li class=”<?php if($_REQUEST==”:wink:{ echo ‘current’; }?>”> “> <?php echo ALL;?>

<li class=”<?php if($_REQUEST==’review’:wink:{ echo ‘current’;}?>”> “> <?php echo REVIEWS;?>

<li class=”<?php if($_REQUEST==’rating’:wink:{ echo ‘current’;}?>”> “> <?php echo RATING;?>

<li class=”i_next”> <?php next_posts_link(NEXT_TITLE) ?>

<li class=”i_previous”><?php previous_posts_link(PREVIOUS) ?>

But I want to sort them by votes. Is it possible? Please help! Thanks!

  • Kimberly
    • Champion of Loops

    mario212

    Hi there!

    I am going to ask the developer to comment here. It may take a bit longer to resolve than an normal support ticket.

    In the meantime, you may want to check out the code within the most popular voted widget file for clues. :slight_smile:

    Best,

    Kimberly

  • PC
    • WPMU DEV Initiate

    Helli mario212,

    I appreciate you patience while we wait for our lead developer to comment here and thank you for being such a great member of the community !

    I am sending another note to our Dev and will wait along with you to see this getting sorted out :slight_smile:

    Cheers

    PC

  • Vladislav
    • Dead Eye Dev

    Hello,

    This really depends on how you’re implementing the actual posts output. At the moment, because of the way the votes are stored, interacting with WP_Query instances in this way would be quite difficult, so you’d really have to look into using a non-standard loop and filter out posts that aren’t of your custom type.

  • aecnu
    • WP Unicorn

    Greetings mario212,

    We have not heard back from you as to the status of this issue.

    If you are still having an issue please let us know so that we may try to get you fixed up as soon as possible by choosing to check mark this ticket as unresolved below and posting any new errors or symptoms you are noticing.

    This action will also bring your ticket up front back in plain view again within the ticket system.

    Thank you for being a WPMU Dev member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.