WordPress.org

Support

Support » Plugins and Hacks » HMS Testimonials » Index in pagination is off by 1

Index in pagination is off by 1

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jeff K

    @kreitje

    I will look into this hopefully sometime soon.

    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

    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

    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

    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

    Plugin Author Jeff K

    @kreitje

    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.

    Plugin Author Jeff K

    @kreitje

    Also can you show me the shortcode you are using.

    Thanks,
    jeff

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Index in pagination is off by 1’ is closed to new replies.
Skip to toolbar