Will someone help me please??
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/
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"]
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' );
@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.
Is the above code pasted from the plugin or are you using that separately to the plugin?
Also, how are you attempting to display the testimonials? Are you using a shortcode?
I am using clean testimonial plugin and this is the code of clean testimonial, this plugin has built-in functionality for displaying plugins.
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.
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.
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.