WordPress.org

Ready to get started?Download WordPress

Forums

Testimonials by Aihrus
[resolved] [Plugin: Testimonial Widget] Shortcode or PHP function for this plugin ? (15 posts)

  1. evo252
    Member
    Posted 2 years ago #

    Hello,

    I'd like to keep this plugin because I love it for its simplicity and efficiency, however, I need to put the widget inside the template via a PHP call function or a shortcode, is there a way to do that ?

    Thank you.

    http://wordpress.org/extend/plugins/testimonials-widget/

  2. j0hnsmith
    Member
    Posted 2 years ago #

    Hi, apologies for the late reply. This is the first wp plugin I've made, I didn't realise there was a forum for it!

    At the moment the only way to access the testimonials is with a widget but to fulfill this and other similar requests I will add a shortcode and php function when I have time, that may not be soon unfortunately.

  3. Michael Cannon
    Member
    Plugin Author

    Posted 2 years ago #

    evo252,

    I've done some updates so far, see http://wordpress.org/support/topic/plugin-testimonial-widget-wrote-multi-instance-widget?replies=2#post-2371089. However, no shortcodes.

    What kind of shortcodes are you wanting?

    I've been thinking of doing some myself, more so of having a complete listing of the entries by like parameters of widgets.

    Ciao!

    Michael

  4. evo252
    Member
    Posted 2 years ago #

    Hello ! It would be nice to have a simple shortcode to call the widget inside a page for instance :)

  5. Michael Cannon
    Member
    Plugin Author

    Posted 2 years ago #

    Have you checked out http://wordpress.org/extend/plugins/quotes-collection/?

    It already has shortcode built in.

    Michael

  6. evo252
    Member
    Posted 2 years ago #

    Thank you very much Michael, I didn't found this plugin before!!! ;)

  7. Hal Gatewood
    Member
    Posted 2 years ago #

    I created a shortcode to list all testimonials on a single page:

    http://snippi.com/s/vrxq152

    Add the code in the URL above and then call it like this:

    [testimonialswidget_list]

  8. Michael Cannon
    Member
    Plugin Author

    Posted 2 years ago #

    Hal, Thanks for the code. I'll drop it in and try out later this week for release. Michael

  9. Debwork
    Member
    Posted 2 years ago #

    Where do you add the code?
    I put it in functions.php and got this error

    Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/areaa1/public_html/test/wp-content/themes/striking/functions.php on line 30

    I am using this on 2 sites so far. :o)

  10. kswan
    Member
    Posted 2 years ago #

    Did anyone get the short code to work for this plugin?

    I was using the previous version successfully using the short code [ts_shcode] but it asked me to update the plugin and now the short code doesn't work. I can only drag it into the sidebar. I want to drop it on a page.

  11. Michael Cannon
    Member
    Plugin Author

    Posted 2 years ago #

    It sounds like your copy and failed had a newline where there shouldn't be one.

    Did you open up functions.php to line 30 and see if the code looked correct?

    Might be as easy as joining a line, removing a spare character or the like.

  12. Michael Cannon
    Member
    Plugin Author

    Posted 2 years ago #

    Please check out 0.2.4 release. It contains shortcode for displaying testimonials by id, tags and other options.

    Fuller shortcode options listed on http://wordpress.org/extend/plugins/testimonials-widget/.

    Thank you Hal Gatewood for your code sample. Do note that your code has a bad variable included in it and therefore doesn't work. I think you accidentally pasted the code twice.

  13. dmx09
    Member
    Posted 1 year ago #

    Is there a php function for this that I could add to a template? Nice plugin btw! ;-)

  14. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Technically, you can create an options array and pass it to testimonialswidget_list_shortcode() for template usage.

    default

    $atts = array();
    
    echo testimonialswidget_list_shortcode($atts);

    full options

    $atts = array(
    	'ids' => false,
    	'limit' => false,
    	'random' =>  false,
    	'hide_author =>  false,
    	'hide_source' => false,
    	'tags' => false,
    );
    
    echo testimonialswidget_list_shortcode($atts);

    Check Shortcode testimonialswidget_list Options for the specifics for using the configuration array on http://wordpress.org/extend/plugins/testimonials-widget/.

    If you want something else, do let me know.

  15. dmx09
    Member
    Posted 1 year ago #

    Wow, quick response! Thanks Michael, much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic