Sort column by rating (wordpress - wp table reloaded - gd star rating)

Sort column by rating (wordpress - wp table reloaded - gd star rating)

remiremi Posts: 1Questions: 0Answers: 0
edited October 2012 in General
Hi,

This is a question I asked on the Wordpress support but no solution could has been found.

My website uses Wordpress 3.4.2, and I manage tables thanks to WP Table Reloaded plugin.

I have integrated gd star rating shortcodes into rows table so users can vote.

For now, the column reads a shortcode for each row ([starrater tpl=10 post=xxxx]) where xxxx is the ID from the post.

So, when I sort the column by desc, it naturally sorts by name, and the higher id is the first.

Example, by desc :

[starrater tpl=10 post=1541]
[starrater tpl=10 post=1540]
[starrater tpl=10 post=1539]

But I need to sort by default the higher value from a vote, which has nothing to do with ID of course.

How can I make wp table reloaded interpret each shortcode rendering ?

Here is a link to the web-page : http://www.alloprod.com/labels-participatifs/

As you can see, I sorted the rows by myself and for now I plan to edit the table manually by changing the order of rows, as soon as I could.

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    I don't know about WP-TableReloaded (or rather where you would put the plug-in for DataTables), but you'd need a sorting plug-in which will pull the information you want from the strings and then sort on them. Documentation here: http://datatables.net/development/sorting

    Allan
This discussion has been closed.