anonymized-13171256
(@anonymized-13171256)
do_shortcode won’t work. Use strong_testimonials_view( $id ); instead. You will have to enqueue the stylesheets too.
This is because the plugin preprocesses the content to find its shortcodes to enqueue the stylesheets in the header. Otherwise they would be loaded in the footer, running the risk of a flash of unstyled content.
anonymized-13171256
(@anonymized-13171256)
For example:
/**
* Load testimonial stylesheets and scripts in custom template.
*/
function my_testimonial_scripts() {
if ( is_page_template( 'page-custom.php' ) ) {
// Load the plugin template stylesheet
wp_enqueue_style( 'wpmtst-style', plugins_url( '/strong-testimonials/templates/default/content.css' ), array(), false );
// Load and configure pagination
wp_enqueue_script( 'wpmtst-pager-plugin' );
wp_enqueue_script( 'wpmtst-pager-script' );
$pager = array(
'id' => '.strong-paginated',
'pageSize' => 5,
'currentPage' => 1,
'pagerLocation' => 'after',
'offset' => apply_filters( 'wpmtst_pagination_scroll_offset', 40 ),
);
wp_localize_script( 'wpmtst-pager-script', 'pagerVar', $pager );
}
}
add_action( 'wp_enqueue_scripts', 'my_testimonial_scripts' );
I obviously have a lot of work to do on the strong_testimonials_view template function to make it on par with the shortcode.
Thread Starter
psjl
(@psjl)
Thanks a lot Chris, you save me!
🙂