JeremyBorum on "[Plugin: Testimonial Rotator] Process to override single template"

ساخت وبلاگ

Hi. I'm using version 2.1.3 of Testimonial Rotator. My WordPress version is 4.4.2.

I'm hoping to override the single template so that we may make some minor modifications. I've placed a copy of /wp-content/plugins/testimonial-rotator/templates/default/single-testimonial.php into /wp-content/themes/[my-theme]/

After I do this I'm getting a solid white screen when I attempt to view a single testimonial. I don't see the header or footer or anything else. I've checked my error logs and I don't see anything there. The single template works when I don't have a copy in my theme folder. It's worth noting that I didn't change anything in the single-testimonial.php file. I only copied it. I also tried updating my permalinks.

The loop-testimonial.php override works great.

Could anyone share with me the proper method for overriding the single template? Any thoughts on what might be causing this strange issue? I'm happy to provide additional info if it would help.

https://wordpress.org/plugins/testimonial-rotator/

I ran into this too - how do you override it?

So it seems that the answer to this (at least for me) was to rename the file single-testimonial.php to single-testimonial-page.php when copying it to your theme directory. This properly overrides the single template.

I didn't find this in the documentation but someone was kind enough to respond with this suggestion and it works well.

I hope this helps someone else.

No. Sorry. I've fooled myself. That doesn't work either. I'm still using the default template.

My apologies for spreading misinformation.

I'll look into this more this week and post back!

I'll be interested in your findings, Hal.
Thanks.

So using single-testimonial.php was a bad idea as WordPress uses that for their template. So if your single.php file used the_content() it would just create a loop and crash.

I am posting an update now that will start to look for content-testimonial.php in your theme folder. This file should content the content from

/wp-content/plugins/testimonial-rotator/templates/default/single-testimonial.php

or

/wp-content/plugins/testimonial-rotator/templates/longform/single-testimonial.php

Also, you'll probably want to modify the wrapper of the testimonial content. To do that you would need to copy your single.php file from your theme and rename it single-testimonial.php. Then change anything in single-testimonial.php that you want to modify.

I'll write up a Help Guide tonight with some examples.

I need this, too, @Hal, so popping in to say THANK YOU!

JeremyBorum
Member
Posted 2 minutes ago #

I'm interested as well, and following this thread now.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 251 تاريخ : جمعه 7 خرداد 1395 ساعت: 0:51