Title: php code instead of shortcode
Last modified: November 15, 2017

---

# php code instead of shortcode

 *  [rocoart](https://wordpress.org/support/users/rocoart/)
 * (@rocoart)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-shortcode-5/)
 * Hi there
    I want to show a testimonial slider on a custom built home page, but
   instead of shortcode (which doesn’t output the desired result) I need to use 
   php code. Haven’t found any reference in your documentation. Can you help with
   a hint? Thank you

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

 *  Plugin Contributor [richardgabriel](https://wordpress.org/support/users/richardgabriel/)
 * (@richardgabriel)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-shortcode-5/#post-9685469)
 * Hey [@rocoart](https://wordpress.org/support/users/rocoart/)!
 * Thanks for using our plugin!
 * I think the easiest way to user our plugin via PHP (for in a template, for example)
   is to use the do_shortcode function.
 * For example, something such as the following:
 *     ```
       <?php echo do_shortcode("[testimonials_cycle]"); ?>
       ```
   
 * Can you let me know if that helps?
 * All the best,
    Richard
 *  Thread Starter [rocoart](https://wordpress.org/support/users/rocoart/)
 * (@rocoart)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-shortcode-5/#post-9707103)
 * Hey Gabriel
 * Thank you for your reply. The code as in your example works still, the problem
   is that I can’t use filters.
    Using the above code will output the entire testimonial
   but I need only the excerpt, without image, displayed randomly. If I use `[testimonials_cycle
   theme="light_style" category="feedback" count="-1" order_by="rand" order="ASC"
   show_title="0" use_excerpt="0" show_thumbs="0" show_date="0" show_other="0" hide_view_more
   ="0" output_schema_markup="1" testimonials_per_slide="1" transition="fade" timer
   ="5000" pause_on_hover="true" auto_height="container" show_pager_icons="1" prev_next
   ="1" display_pagers_above="0" paused="0"]` I got a 500 error. Is there a way 
   I can use filters on to output these correctly? Thank you.
 *  Plugin Contributor [richardgabriel](https://wordpress.org/support/users/richardgabriel/)
 * (@richardgabriel)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-shortcode-5/#post-9733825)
 * Hey [@rocoart](https://wordpress.org/support/users/rocoart/)!
 * I’m not sure I understand what you mean by being unable to use filters. However,
   the do_shortcode function should work fine for the shortcode you have pasted 
   above.
 * Do you have access to your error log? If we could see what the specific error
   is, that would illuminate a lot for me.
 * All the best,
    Richard
 *  Plugin Contributor [richardgabriel](https://wordpress.org/support/users/richardgabriel/)
 * (@richardgabriel)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-shortcode-5/#post-9754533)
 * Hey [@rocoart](https://wordpress.org/support/users/rocoart/)!
 * I just wanted to touch base on this and see if you still need any help?
 * All the best,
    Richard

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

The topic ‘php code instead of shortcode’ is closed to new replies.

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

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)

 * 4 replies
 * 2 participants
 * Last reply from: [richardgabriel](https://wordpress.org/support/users/richardgabriel/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/php-code-instead-of-shortcode-5/#post-9754533)
 * Status: not resolved