Support » Plugin: BNE Testimonials » Testimonials fail on multi-paged views

  • Resolved eisaacson

    (@eisaacson)


    There is an issue where if a shortcode is on a page that has multiple pages (ie /page/2/) then the shortcode tries to pull page 2 of testimonials which will often error out and show the “no testimonials found” message.

    As a workaround, I included these shortcodes before and after the BNE shortcode to pretend for that moment that we are still on page 1. It works.

    [fix_bne_paged_before][bne_testimonials ... ][fix_bne_paged_after]

    
    add_shortcode('fix_bne_paged_before', function(){
    	$_REQUEST['bne_pg'] = get_query_var('paged');
    	set_query_var('paged', 1);
    });
    add_shortcode('fix_bne_paged_after', function(){
    	set_query_var('paged', $_REQUEST['bne_pg']);
    	unset($_REQUEST['bne_pg']);
    });
    

    It would be great to have this fixed or even if there’s a hook that I can tie in to before and after so I don’t have to add shortcodes every time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Kerry

    (@bluenotes)

    Hmm, interesting. I suppose you have this on a sidebar with a blog archive page or similar.

    Go to /includes/shortcode-display.php, line 190. There you’ll see the paged query arg setup

    Wrap that with

    if( $atts['pagination'] == 'true' ) { .... }

    Should look like the following when edited.

    if( $atts['pagination'] == 'true' ) {
    	if( get_query_var( 'paged' ) ) {
    		$query_args['paged'] = get_query_var('paged');
    	} elseif( get_query_var( 'page' ) ) {
    		$query_args['paged'] = get_query_var( 'page' );
    	} else {
    		$query_args['paged'] = 1;
    	}
    }

    I’ll have this in the next update. For further discussion, since this refers to the pro version, please contact me from the support site. Not here.

    Thread Starter eisaacson

    (@eisaacson)

    That would be great. Thank you!

    Plugin Author Kerry

    (@bluenotes)

    You’re welcome. Go ahead and make that adjustment in the plugin as there is no time frame set for that next update release.

    Thread Starter eisaacson

    (@eisaacson)

    If I did that, wouldn’t I just hoping that it makes in the next update then? If not, I’ll be reverted back to my same issue. That’s why I don’t love updating the plugin code. I’m going to keep my workaround it in my functions.php until we know things are going to work natively. It would be great to know when this is updated though.

    Plugin Author Kerry

    (@bluenotes)

    Did I not mention that it would be in the next update? Meaning, if you make the change now, then you would not have to worry about it as it would also be included when I release the next version. I don’t have a time frame when the next update would be release.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.