In this article I show how 'testimonial' CPT entries made available by Testimonials by WooThemes plugin can be output using Bill Erickson's Display Posts Shortcode plugin and displayed as a responsive carousel using Slick jQuery script.
The reason for not using Testimonials plugin's built-in shortcode is because it did not seem possible with the generated HTML to float the featured image to the left with the content wrapping around it on the right. For 100% control on the HTML output incl. the case when you need to show testimonial CPT related custom fields like Byline and URL, writing a custom query + loop is the way to go (example). For this tutorial though, we shall use Display Posts Shortcode to keep it simple.
Step 1
Install and activate Testimonials by WooThemes and Display Posts Shortcode plugins.
Step 2
Download Slick and extract the zip file.
Upload slick.min.js to child theme directory/js.
Upload fonts folder, ajax-loader.gif, slick.css and slick-theme.css to child theme directory/css.
Create a file named say, slick-init.js child theme directory/js having the following code:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
I followed the steps as outlined above but wanted to point out that the “slick.css.map” file was NOT included in the SLICK zip file?
Lastly when I tested out the widget with shortcode it did NOT appear as yours does in this tutorial? Is that because the “slick.css.map” is NOT present?
The version of Slick when I wrote the tutorial was 1.3.15. I see that the latest version is 1.4.0.
I will test the latest version and update my article. Shall add another comment here when I do.
Done.
The difference is that slick.css.map has been replaced with slick-theme.css. So you need to also upload that file to ‘css’ directory and enqueue it.
Updated and everything works and looks great! Thanks.
Hey Sridhar,
I can’t seem to get the scrolling (next – previous sections) to work… I’m working with the centric theme (heavily customized using your tutorials here).
I followed the instructions but can’t figure out why it won’t work.
http://forgeddesign.com/v2/ (towards the bottom, widget area).
http://forgeddesign.com/v2/wp-content/themes/forged/js/slick-init.js does not exist. Can you check that and all the other resources needed to make this work?
Beautiful! Thanks, works perfectly now. Can’t believe I missed that. Thanks again for this site. I’ve learned a ton here and continue to learn more everyday!
Great tutorial. Just one thing how do I get the byline to display in the page?
Use
get_post_meta( get_the_ID(), '_byline', true );
Source: https://wordpress.org/support/topic/get-byline?replies=9#post-6746263
As I write near the beginning of this tutorial,
Any update on getting the byline to show?
Hi Sridhar,
Thank you so much for this tutorial, it is what I was looking for. However, I have 2 problems: there is a dash line( ‘-‘ ) displayed before every post and I can’t figure out how to get rid of it. Also, I didn’t create the testimonials using the testimonials plugin that you have recommended, but through a CPT because I want to minimize plugin usage. Is there a way to display the ACF values created in the testimonial CPT?
Thank you in advance!
Ok, I got ride of the dashed line by changing “include_excerpt” to include_content=”true”, which make sense since the testimonials are actually full post not excerpt, and I did not create excerpt for the CPT.
If you can give me some guidance regarding displaying ACF values, that would be so appreciated!
Here is sample modified be_display_posts_read_more() function to do what you want: http://pastebin.com/raw/kdheniaf
Thank you so very much for your help, Sridhar! This works excellently!
Hi Sridhar, I have triple checked that I have uploaded all of the files but the site is not displaying the testimonials as expected. This is the page in question: https://www.deluxe-designs.net/whattoeat/testimonials/
Is it possible that because this is an older tutorial that there is a conflict preventing them to display? Is there any updated option? Thank you!
Hi,
Note the last step of the tutorial. You will see the output of this tutorial wherever that shortcode is pasted.
https://www.deluxe-designs.net/whattoeat/testimonials/ is currently showing the default
testimonial
CPT’s archive page.What you can do is replace the default loop with a custom one to output the shortcode on this CPT archive page.
archive-testimonial.php
:Thank you for your quick reply. I have edited the page to reflect what I was seeing even when I entered the shortcode in a widget. See:
https://www.deluxe-designs.net/whattoeat/endorsements/
It is displaying 2 testimonials which is fine, however it is not scrolling so I am not sure what I may have missed.
I figured this was something silly and it was. I did add the archive-testominial.php template so actually this wasn’t for nothing; it was helpful. Ultimately the scroll arrows were set to white so it looked as though they weren’t there. I think I can troubleshoot the rest by fixing up the css to match my template. Thank you for your assistance with the archive custom loop!