Title: [Plugin: Testimonials Widget] Support for PHP methods
Last modified: August 20, 2016

---

# [Plugin: Testimonials Widget] Support for PHP methods

 *  Resolved [Veysel Cetiner](https://wordpress.org/support/users/veysel-cetiner/)
 * (@veysel-cetiner)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/)
 * Im having trouble embedding the php methods in the Main Index Template (index.
   php) of the theme that I am using.
 * I have tried the following:
 *     ```
       <?php echo testimonialswidget_list(); ?>
       ```
   
 *     ```
       <?php
       $t_args = array( "hide_source=true", "hide_url=true");
       echo testimonialswidget_list($t_args);
       ?>
       ```
   
 *     ```
       <?php
       $t_args = array( "hide_source" => true, "hide_url" => true);
       echo testimonialswidget_list($t_args);
       ?>
       ```
   
 * Please advise.
 * [http://wordpress.org/extend/plugins/testimonials-widget/](http://wordpress.org/extend/plugins/testimonials-widget/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Veysel Cetiner](https://wordpress.org/support/users/veysel-cetiner/)
 * (@veysel-cetiner)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/#post-3101820)
 * update: also tried to include/require testimonials-widget.php
 *     ```
       <?php
       require('testimonials-widget/testimonials-widget.php');
       echo testimonialswidget_list();
       ?>
       ```
   
 *  Plugin Contributor [Michael Cannon](https://wordpress.org/support/users/comprock/)
 * (@comprock)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/#post-3101914)
 * Is the plugin installed and activated? After that, the `echo testimonialswidget_list();`
   code you have should be working fine.
 * Any errors? If so, please copy and paste the entire message.
 *  Thread Starter [Veysel Cetiner](https://wordpress.org/support/users/veysel-cetiner/)
 * (@veysel-cetiner)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/#post-3101917)
 * Thanks for the quick reply Michael. The plugin is installed and activated and
   I am able to use the short code on pages to display a list of testimonials. I
   did find a couple of things in the error logs though.
 * From error log in plugin directory:
    [08-Oct-2012 15:05:23] PHP Fatal error: 
   Call to undefined function add_action() in /home/***/public_html/***/wp-content/
   plugins/testimonials-widget/testimonials-widget.php on line 39
 * from error log in site directory:
    [08-Oct-2012 18:53:54] PHP Fatal error: Call
   to undefined function testimonialswidget_**widget**() in /home/***/public_html/***/
   wp-content/themes/customtheme/index.php on line 80
 * [08-Oct-2012 18:56:25] PHP Fatal error: Call to undefined function testimonialswidget_**
   list**() in /home/***/public_html/***/wp-content/themes/customtheme/index.php
   on line 78
 * One more question, Is it possible to call the methods with no parameters or should
   I pass an empty array?
 * Thanks!
 *  Thread Starter [Veysel Cetiner](https://wordpress.org/support/users/veysel-cetiner/)
 * (@veysel-cetiner)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/#post-3101977)
 * Figured it out finally. The class that the methods belong to isn’t static, so
   you have to instantiate the class first and call the methods as member functions.
 *     ```
       <?php
       $t_widget = new Testimonials_Widget();
       echo $t_widget->testimonialswidget_widget();
       ?>
       ```
   
 *  Plugin Contributor [Michael Cannon](https://wordpress.org/support/users/comprock/)
 * (@comprock)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/#post-3102007)
 * You’re right, I’m a bonehead on this one. I’ll get a fix into place soon.
 *  Plugin Contributor [Michael Cannon](https://wordpress.org/support/users/comprock/)
 * (@comprock)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/#post-3102026)
 * Upcoming release resolves the issue of needing the instantiate the class.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Testimonials Widget] Support for PHP methods’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/testimonials-widget_c56561.svg)
 * [Testimonials Widget](https://wordpress.org/plugins/testimonials-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/testimonials-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/testimonials-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/testimonials-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/testimonials-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/testimonials-widget/reviews/)

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [methods](https://wordpress.org/support/topic-tag/methods/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 6 replies
 * 2 participants
 * Last reply from: [Michael Cannon](https://wordpress.org/support/users/comprock/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-testimonials-widget-support-for-php-methods/#post-3102026)
 * Status: resolved