Thank you for the compliment.
First off, bad copy and paste. testimonialswidget_list_shortcode
vs. testimonialswidget_widget
.
Second, just use <?php echo testimonialswidget_widget(); ?>
.
limit=1
means to only pull one testimonial. Therefore, how can you rotate if there’s only one?
Hi Michael,
It’s really great to get a reply from the actual plugin author so thanks a bunch for writing back.
The only code that doesn’t give me an error message or break the entire site is the one I posted above. This one:
<?php
$args = array(
‘limit’ => 1,
‘random’ => true,
);
echo testimonialswidget_list_shortcode( $args );
?>
I tried all of these and none of them worked:
testimonialswidget_widget
testimonialswidget_widget_shortcode
testimonialswidget_list
All of these functions gave me an error message on the page saying that they are undefined. Do I need to first define them somewhere?
I tried putting <?php echo testimonialswidget_widget(); ?> in my functions.php like you suggest in your FAQ but this broke the whole site.
Aaron
Is Testimonials Widget plugin activated?
Please double-check and then if the <?php echo testimonialswidget_widget(); ?>
code breaks again, copy and paste the error message here.
Yes, the plugin is activated. That would be the easiest solution I suppose.
Sorry to be dense but should I put <?php echo testimonialswidget_widget(); ?> into my functions file or use it in my template?
When I put <?php echo testimonialswidget_widget(); ?> into my homepage template I get this error message on the page itself:
Fatal error: Call to undefined function testimonialswidget_widget() in /home/content/14/5985714/html/subdomains/karen/wp-content/themes/ksquared/tmp-home.php on line 43
When I put <?php echo testimonialswidget_widget(); ?> into my functions.php the whole site is broken.
Aaron
Aaron,
You can put the <?php echo testimonialswidget_widget(); ?>
code into the template file directly, where you want Testimonials Widget to display.
It sounds like your theme is loading up before the plugins. I’m not sure if this is normal behavior or not. Therefore, you might try to fuller code before to include your one-off.
<?php
include_once( WP_PLUGIN_DIR . '/testimonials-widget/testimonials-widget.php' );
echo testimonialswidget_widget();
?>