• merkin51

    (@merkin51)


    This is a great plugin and certainly a lot slicker than the other testimonial plugins I tried. One thing that I don’t like though is the way it defaults to randomizing testominals when displaying all on a page, I’d rather it just listed them in order of submission. Can anyone tell me how to edit the code to do this?

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

Viewing 1 replies (of 1 total)
  • Thanks for the kind words, and I’m sorry that I didn’t see this sooner. We’ve been very busy of late working on a new product that we’ll be releasing in the coming weeks. Anyway, on to your question….

    A sorting option really should be included with the plugin by default, however, to be honest, we simply hadn’t thought of it. I’ll make sure we include that in our next version, however, that’s a ways off. Perhaps, we could release a minor version update sooner, however, in the mean time, here’s how you can resolve this.

    1. Open /wp-content/plugins/collision-testimonials/collision-testimonials.php in the code editor of your choice.
    2. On around line 386, you should see the following…
      $featured = "SELECT * FROM $testimonials WHERE status!='1' AND status!='2' AND featured='1' ORDER BY RAND()";
    3. Replace that line with the following….
      //$featured = "SELECT * FROM $testimonials WHERE status!='1' AND status!='2' AND featured='1' ORDER BY RAND()";
      
      $featured = "SELECT * FROM $testimonials WHERE status!='1' AND status!='2' AND featured='1' ORDER BY id DESC";
    4. On around line 421, you should see the following…

      $query = "SELECT * FROM $testimonials WHERE status!='1' AND status!='2' AND featured!='1' ORDER BY RAND() LIMIT $generate_x";

    5. Replace that line with the following….
      //$query = "SELECT * FROM $testimonials WHERE status!='1' AND status!='2' AND featured!='1' ORDER BY RAND() LIMIT $generate_x";
      
      $query = "SELECT * FROM $testimonials WHERE status!='1' AND status!='2' AND featured!='1' ORDER BY id DESC LIMIT $generate_x";

    NOTE: I haven’t tested this, however, the above should work correctly. If it doesn’t work, please let me know what happened, and I’ll look into it further.

    If you aren’t comfortable making these changes, then just reply back and I’ll make them for you.

    Again, sorry for the long delay in response.

    Thanks,
    Jacob

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Collision Testimonials] Stop the random order when used on page?’ is closed to new replies.