• Resolved psjl

    (@psjl)


    After edit some views to display testimonials none of the layouts settings seens to work in my view template.

    The plugin layout no more works, don’t get the pagination or count or color or layout or noting that i set in views edit.

    my shortcode call:
    echo do_shortcode("[testimonial_view id=".$id."] " );

    Need some help!!!!

    https://ww.wp.xz.cn/plugins/strong-testimonials/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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!

    🙂

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

The topic ‘Plugin broken: don't get views layout’ is closed to new replies.