Jan van Dank
Member
Posted 8 months ago #
Small feature suggestion: Add a "limit" parameter to the Category Listing mode. So if I have 15 testimonials in a category I can tell the plugin to only display e.g. the first 3 ones.
How to implement it: Insert 'limit' => '-1', on line 411 of "tb-testimonials.php". Then on line 514 replace 'posts_per_page' => '-1', with 'posts_per_page' => $limit,. Done!
I hope you will add this feature to the next release. :-)
Regards,
Jan
http://wordpress.org/extend/plugins/tb-testimonials/
Jan, consider it added. Can't promise which version, but it's on the long list. Also you might be interested in some ajax pagination I put together for another user, you can find it here http://pastebin.com/CaaKV5Cq
Thanks,
Travis Ballard
Also, here's how you would use those added template tags to do the pagination
{% if paged %}
<p>Testimonials Page <em>{{ paged }}</em></p>
<div id="testimonials-page-{{ paged }}">
{% for testimonial in testimonials %}
<p>{{ testimonial.post_title }}</p>
{% endfor %}
</div>
<div class="testimonial-pagination">
{% if prev_testimonial_link %}
<p class="l"><a href="{{ prev_testimonial_link }}">Prev</a></p>
{% endif %}
{% if next_testimonial_link %}
<p class="r"><a href="{{ next_testimonial_link }}">Next</a></p>
{% endif %}
</div>
{% endif %}
bansalnaveen
Member
Posted 8 months ago #
Travis, I have just started to use the TBTestimonial plugin. I need the output to show category-wise limited to 5 per page. I was trying to do the pagination. I have seen the code given on here http://pastebin.com/CaaKV5Cq , but I am not sure how to use it? where to embed it? and how the output will show pagination and where the pagination code above will need to be pasted? Please help me on this issue or guide me or provide some tutorial to do it myself. Thanks
bansalnaveen: have you figured this out yet? if not use the TB icon in your admin bar to send me an email.
Thanks,
Travis