This is by no means a universal solution but it will do until I can build better template functions into the plugin.
Add this to your theme’s functions.php:
/**
* Pre-process the Strong Testimonials shortcode.
*
* For when the shortcode is used in a theme template file.
*/
function do_strong_shortcode( $content ) {
$options = get_option( 'wpmtst_options' );
preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
foreach ( $matches as $key => $shortcode ) {
if ( 'strong' === $shortcode[2] ) {
// Load styles and scripts
if ( $options['load_page_style'] )
wp_enqueue_style( 'wpmtst-style' );
$parsed_atts = shortcode_parse_atts( $shortcode[3] );
$att_string = serialize( $parsed_atts );
$atts = normalize_empty_atts( $parsed_atts );
// minimal subset of all shortcode atts
extract( shortcode_atts(
array(
'slideshow' => '',
'category' => '',
'count' => -1,
'per_page' => '',
'nav' => 'after',
'id' => '',
'show_for' => '8',
'effect_for' => '1.5',
'no_pause' => 0, // must be zero not boolean or string!
),
$atts
) );
if ( $slideshow ) {
wp_enqueue_script( 'jquery-cycle', WPMTST_URL . 'js/jquery.cycle.all.min.js', array( 'jquery' ), '2.9999.5', true );
wp_enqueue_script( 'wpmtst-slider', WPMTST_URL . 'js/wpmtst-cycle.js', array ( 'jquery-cycle' ), false, true );
// Populate variable for Cycle script.
$args = array (
'fx' => 'fade',
'speed' => $effect_for * 1000,
'timeout' => $show_for * 1000,
'pause' => $no_pause ? 0 : 1
);
wp_localize_script( 'wpmtst-slider', 'strong_cycle_' . hash( 'md5', $att_string ), $args );
}
}
}
echo do_shortcode( $content );
}
Use this in your front-page.php:
echo do_strong_shortcode( '[strong slideshow excerpt show_for="2" effect_for="1"]' );