• Next and previous not work for me in clean testimonial plugin, i am showing two testimonial per page but when i click to next it does not show the next two testimonial, if i manually change the page number in code then it shows the testimonials for that page but then previous and next does not works.Here is code for pagination.Please help me out of this issue.thank you.

    echo paginate_links( array(
    					'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    					'format' => '?paged=%#%',
    					'current' => max( 1, get_query_var('paged') ),
    					'total' => $wp_query->max_num_pages
    				) );

    https://wordpress.org/plugins/clean-testimonials/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter asad.fida

    (@asadfida)

    Will someone help me please??

    Thread Starter asad.fida

    (@asadfida)

    here is the link where I am getting issue of pagination please go to this link and then go to “Reviews” tab next to “Class Description” Tab to view the problem.
    bubblegumlabs.com/tinker/class/fall14-age2-wedsb-centralpark-manhattan/

    Plugin Author lukerollans

    (@hellolukerollansme)

    Hi asad.fida,

    Are you using your own code to output pagination? If so, that won’t work.

    Use the “per_page” shortcode attribute and Clean Testimonials will take care of it for you.

    [testimonials per_page="2"]

    Thread Starter asad.fida

    (@asadfida)

    Hi lukerollans,
    Here is my full code

    function shortcode_testimonials ($atts) {
    
    	$args = array(
    
    		'posts_per_page' => isset( $atts['per_page'] ) ? $atts['per_page'] : 2,
    		'paged' =>get_query_var( 'paged' ),
    		'order' => isset( $atts['order'] ) ? $atts['order'] : 'DESC',
    		'orderby' => isset( $atts['orderby'] ) ? $atts['orderby'] : 'date',
    		'post_type' => 'testimonial
    
    	);
    
    	$output = '';
    
    	if( isset( $atts['category'] ) ) {
    
    		$ids 	= explode( ',', $atts['category'] );
    		$slugs = array();
    
    		foreach( $ids as $id ) {
    			if( $term = get_term_by( 'id', $id, 'testimonial_category' ) ) {
    				$slugs[] = $term->slug;
    			}
    		}
    
    		$args['testimonial_category'] = implode( ',', $slugs );
    
    	}
    
    	if( query_posts( $args ) ) {
    
    		if( have_posts() ) {
    
    			ob_start();
    
    			echo '<div class="testimonial-category">';
    
    			while( have_posts( ) ) {
    
    				the_post();
    
    				$testimonial = new WP_Testimonial( get_the_ID() );
    				$testimonial->word_limit = ( isset( $atts['word_limit'] ) && is_numeric( $atts['word_limit'] ) ? $atts['word_limit'] : -1 );
    				$testimonial->render();
    
    			}
    
    			if( function_exists( 'wp_paginate' ) ) {
    
    				wp_paginate();
    
    			}
    			else {
    				echo '<div class="testimonial-pagination">';
    
    				global $wp_query;
    
    				$big = 9999999;
    
    				echo paginate_links( array(
    					'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    					'format' => '?paged=%#%',
    					'current' => max( 1, get_query_var('paged') ),
    					'total' => $wp_query->max_num_pages
    				) );
    
    				echo '<button type="button">click Me</button>';
    				echo '</div>';
    			}
    
    			echo '</div>';
    
    			$output = ob_get_contents();
    			ob_end_clean();
    
    		}
    
    		wp_reset_query();
    
    		return $output;
    
    	}
    
    }
    
    add_shortcode( 'testimonials', 'shortcode_testimonials' );

    Thread Starter asad.fida

    (@asadfida)

    @lukerollans
    My issue is like this thread Link to thread
    but the solution this provides is for Woocommerce 2.0.0 but i am using 2.2.2 so help me out of this issue.
    Thanks.

    Plugin Author lukerollans

    (@hellolukerollansme)

    Is the above code pasted from the plugin or are you using that separately to the plugin?

    Plugin Author lukerollans

    (@hellolukerollansme)

    Also, how are you attempting to display the testimonials? Are you using a shortcode?

    Thread Starter asad.fida

    (@asadfida)

    I am using clean testimonial plugin and this is the code of clean testimonial, this plugin has built-in functionality for displaying plugins.

    Thread Starter asad.fida

    (@asadfida)

    I am using clean testimonial plugin and this is the code of clean testimonial, this plugin has built-in functionality for displaying testimonials.I a not displaying by my code.

    Plugin Author lukerollans

    (@hellolukerollansme)

    Hi asad.fida,

    I’m sorry, but I have no idea what you’re talking about.

    To display testimonials on a page, add this shortcode to the page
    [testimonials].

    You should never have to look at or modify the code of the plugin.

    Thread Starter asad.fida

    (@asadfida)

    Hi lukerollans
    Displaying testimonials is not a issue, issue is testimonials pagination not works.Here is the link Tinker go to this link and open

    “Reviews tab”

    and click on the pagination link 2 or next it does not show the next testimonials rather it redirects to the same page.
    Hope now you will get the real issue if not let me know.
    Thank you for your intrest.

    I’m working with Asad on this. They’re hooking a filter for a WooCommerce product tab with do_shortcode('[testimonials]'). Since it’s in a tab, the pagination args are going to the top page instead. I’m not sure there’s a way around that.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Pagination not works in clean testimonials for me’ is closed to new replies.