• rocoart

    (@rocoart)


    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

    (@richardgabriel)

    Hey @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

    (@rocoart)

    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

    (@richardgabriel)

    Hey @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

    (@richardgabriel)

    Hey @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.