WordPress.org

Forums

HMS Testimonials
Index in pagination is off by 1 (8 posts)

  1. azti
    Member
    Posted 12 months ago #

    Greetings,

    Thanks for the work on this plugin... I am using it in: http://www.worldwithoutparasites.com

    It appears to me that pagination is off by 1. I am putting up a link url, for a full version of a Testimonial, within a short (excerpt testimonial) despite putting up the correct index number. the correct content is available at index - 1 rather than at index.

    Could you please check this?

    thanks...

    --Azti

    https://wordpress.org/plugins/hms-testimonials/

  2. Jeff K
    Member
    Plugin Author

    Posted 12 months ago #

    I will look into this hopefully sometime soon.

  3. azti
    Member
    Posted 12 months ago #

    I verified this by showing index numbers as displayed fields in the templates. When the correct content is shown, the index is off by one. I.E. it is accessible via one less than the actual index number. Additionally, if I have 30 testimonials, the pagination shows 29. It is certainly an issue with an array index that must be 0 based not being adjusted for displaying as if starting at 1.

    ---o---

    Regardless, I am going to have to undo my scheme for offering a URL embedded at the end of a short excerpt Testimonial that has a related full length testimony. The problem with it is if I set the maximum words at a particular value, and the value is exceeded by enough, then the embedded URL displays correctly (other than the index issue) when the user follows the "more" link, the entire "excerpt" text is displayed and then contains the link that I embedded to the full testimonial ID of the full text. The problem is that when the number of words in the testimonial is less than the cutoff but the embedded url is more, your code eats the URL... As it page breaks as well, BTW...

    ---o---

    In any case, What I really need is a feature where, at Testimonial creation, there is an option to set whereby a field containing an Excerpt of the full testimonial is displayed and after the excerpt a link to the full text of the Testimonial contained in another field...

    If I had the time I would try to hack that in and submit it back...

    Thanks again...

    --Azti

  4. azti
    Member
    Posted 12 months ago #

    hm... very, very strange... I found that the problem began to occur around index number 16. When I clicked on the pagination code's rendered url for 16 I got 17 displayed and the same all the way through till the last....

    I looked in the database and found that one of the testimonial at 17 was a duplicate of 16... Something strange must have happened in the database...

    I went into the database manually, deleted the errant record, and then edited each subsequent record's id field and decremented it by 1. Now all seems in sync...

    Still, you might have a look... something weird happened...

    --Azti

  5. azti
    Member
    Posted 12 months ago #

    No... Its still messed up... However, it doesn't appear to be an issue in the database... as it is all consistent now...

    go to:

    http://www.worldwithoutparasites.com/all-testimonials/?hms_testimonials_page=14

    the above url's index field outputs 14, as it should. However:

    if you go to:
    http://www.worldwithoutparasites.com/all-testimonials/?hms_testimonials_page=15

    it should be at 15. But its 16...

    I'm using a Custom Field now to resolve the other problem of making available the full text of a Testimonial from the "excerpt" testimonial... However, I'm going to have to adjust these indexes from 15 forward until you can find and fix this...

    Thanks...

    --Azti

  6. azti
    Member
    Posted 12 months ago #

    HAH! I found it... The problem is I had one Testimonial that was a duplicate and had set it not to display. I had forgotten that. Apparently if you set it not to display, the code does not adjust the pagination display and url...

    --Azti

  7. Jeff K
    Member
    Plugin Author

    Posted 12 months ago #

    Thanks for your debugging debugging help.

    In your last message, if I understand you right, it includes the testimonials not displayed in the pagination results but does not show them in the output?

    ----
    In any case, What I really need is a feature where, at Testimonial creation, there is an option to set whereby a field containing an Excerpt of the full testimonial is displayed and after the excerpt a link to the full text of the Testimonial contained in another field...
    ----

    There is a field you can set to take you to the full testimonial page. It's at the bottom of the add / edit testimonial page called "Read More Page". I might look into adding in an excerpt field so you have more control vs just character or word limits.

  8. Jeff K
    Member
    Plugin Author

    Posted 12 months ago #

    Also can you show me the shortcode you are using.

    Thanks,
    jeff

Reply

You must log in to post.

About this Plugin

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

About this Topic

Tags

No tags yet.