Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have installed a widget so that I may add testimonials. This widget cycles through the testimonials in the sidebar and everything is fine. What I now want to do is create a testimonials page that retrieves all the entries from this widget. The functionality already exists in the widget to retrieve all the testimonials, however I cannot find a way to get the widget explicitly.

I have tried the_widget() but cannot work out what the widget's PHP class name is.

Is there another way of grabbing this widget?

[edit] @user8982, thank-you for your suggestions, however this is not what I require.

  • I am using Wordpress V3.2.
  • 1, The plugin I am tring to access is 'Testimonials Widget' by
    'j0hnsmith'.
  • I am using a custom theme.

I have already created a template file.

I have a testimonials widget registered in the main sidebar. I would like to, in my template, retrieve this widget (as an object preferably) and have it echo every testimonial instead of showing/hiding them one at a time.

share|improve this question
1  
Does it create a new database table? You may need to run a custom sql query to get the testimonials on your template. –  Rutwick Gangurde Oct 3 '11 at 10:02
    
Yes, it does. I was hoping there was a way to do it without resorting to creating my own sql... –  Richard Parnaby-King Oct 3 '11 at 10:09
    
@Rutwick Gangurde: Can you create an answer please. –  Richard Parnaby-King Oct 3 '11 at 10:21
    
Build a custom sql query that selects the latest testimonials from the table that the plugin creates. Use $wpdb->get_results($sql_query) to get the results as an array, and then loop over it in your markup. What testimonial plugin are you using? –  Rutwick Gangurde Oct 3 '11 at 10:51
    
@rutwick What I meant was, create an answer post so I can mark it as the answer. I have duplicated the sql in the widget into the template and it works. –  Richard Parnaby-King Oct 3 '11 at 12:42

2 Answers 2

up vote 1 down vote accepted

Build a custom sql query that selects the latest testimonials from the table that the plugin creates. Use $wpdb->get_results($sql_query) to get the results as an array, and then loop over it in your markup.

share|improve this answer

First of all when ever you ask any question you should mention in which environment you are working. like-

  1. Wordpress Ver
  2. Plugin Name
  3. Your theme name
  4. Any other specification etc

Regarding your question i think below links are useful please have a look

  1. http://webdesign.anmari.com/1649/shortcode-any-widget/
  2. http://codex.wordpress.org/WordPress_Widgets

To create custom template you have to create a php file for example

For more details see below link. use http://

codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.