WordPress.org

Forums

WH Testimonials
Reverse order?? (8 posts)

  1. sleenmg
    Member
    Posted 2 years ago #

    I see that this has been asked before but I could not find an answer. I would really like the newest ones first not the old ones. Any way to reverse it?

    Thanks

    http://wordpress.org/extend/plugins/wh-testimonials/

  2. ClaytonJames
    Member
    Posted 2 years ago #

    I'm not the plugin author, but if you're feeling adventurous and don't mind a little editing, you might give this a try. - As always, make a backup copy before you edit, just in case it doesn't work.

    Open /wp-content/plugins/wh-testimonials/wh-testimonials.php in an editor. Near the end of line 412 you will find this;

    order by RAND() LIMIT $Wh_setlimit");

    Try changing it to this;

    ORDER BY wh_id DESC LIMIT $Wh_setlimit");

    ...and save your changes. I think that might do what you are asking.

  3. digitaldude400d
    Member
    Posted 2 years ago #

    I tried this and it wasnt successful. Could be I did something wrong but I was pretty sure I did it right. Once I saved the changes it added a testimonial saying thank you for installing WH Testimonial

  4. ClaytonJames
    Member
    Posted 2 years ago #

    @digitaldude400d

    Once I saved the changes it added a testimonial saying thank you for installing WH Testimonial

    That appears to be the default message installed with the plugin. You can delete it from testimonials setup pages in your dashboard.

    Go to Testimonials > Settings > "Number of testimonials to show in sidebar" and change it to a number higher than "1". Then setup your sidebar widget and the page you want it displayed on.

    Now go back and add some fake testimonials just to test the order. I just created 5 testimonials. test 1, test 2, test 3, etc... be sure to add some information in each "short text" field.

    Visit your side bar. Every time you refresh the page, the order should change because the default is random order.

    Now edit /wh-testimonials.php exactly as I indicated above, and save the changes you made to the file, and exit the editor. Go back to your site and view the testimonials in the sidebar again. They should now be in order from newest to oldest. (test 5, test 4, test 3, test 2...)

    I just tested it on WP 3.4.1, and it seemed to work okay for me.

    Good luck!

  5. digitaldude400d
    Member
    Posted 2 years ago #

    I havent tried this for the widget. I was hoping that this would work in the testimonial page where it shows all the testimonies. Ill look deeper into this and hope I can come up with a solution.

  6. ClaytonJames
    Member
    Posted 2 years ago #

    For descending order on the testimonial page this seems to work for me.

    Line 727 in /wh-testimonials.php

    $tstpage = $wpdb->get_results("SELECT wh_id,wh_clientname,wh_company,wh_text_full,wh_homepage,wh_sfimgurl FROM $table_name WHERE wh_text_full !='' ORDER BY wh_id DESC");
  7. digitaldude400d
    Member
    Posted 2 years ago #

    Thank you so much Clayton this worked perfectly.

  8. ClaytonJames
    Member
    Posted 2 years ago #

    You're welcome. I'm glad it worked.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WH Testimonials
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic