Forums Forums Search & Filter Pro Pagination with search results not letting me click on or back to page 1

Viewing 10 posts - 1 through 10 (of 15 total)
  • Anonymous
    #50496

    Hi,
    I’ve run into an issue where the pagination for my search results is not letting me click on page 1, and the ‘previous’ arrow works up until page 2, and then will not take me back to page 1 from there. This only seems to be an issue with the first page; it works just fine for the last page. Trevor sent me a new version of the plugin, wondering if there was a fix for this afterwards, or if you could help us implement a fix for this until the new version comes out. Please let me know.

    We are using WordPress’s default twentysixteen theme.

    Thanks,
    Tina

    Trevor
    #50540

    Hi Tina

    I am going to drop this in Ross’s in tray.

    Anonymous
    #50816

    Hi Ross,
    Any updates on this? It’s a bug we’ve found on production and we are trying to fix it quickly. Please let me know if you can replicate the issue.

    Trevor
    #50818

    I think you and I are going to have to try and see what the issue is Tina, as Ross is busy.

    Anonymous
    #50918

    Ok. Is there any way I can help? Let me know if you would like to do a screenshare. I noticed the issue on our old version of the plugin, and the new.

    Trevor
    #50929

    I think that, yes, we will have to do a screenshare.

    Trevor
    #51136

    Tina

    Can you show us the pagination code you have? Not sure where it is the theme you have (it may be a function in functions.php). I have tested it in 2016 on my server and all is well.

    The author thing is fixed in the full release version.

    Anonymous
    #51196

    Hi Trevor,
    Here is an example of the pagination code we have:

    Within our index.php page:
    
    // Previous/next page navigation.
    the_posts_pagination( array(
    	'mid_size'			 => 2,
    	'prev_text'          => __( 'Previous page', 'twentysixteen' ),
    	'next_text'          => __( 'Next page', 'twentysixteen' ),
    	'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
    ) );
    
    Within link-template.php:
    
    function get_the_posts_pagination( $args = array() ) {
    	$navigation = '';
    
    	// Don't print empty markup if there's only one page.
    	if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {
    		$args = wp_parse_args( $args, array(
    			'mid_size'           => 1,
    			'prev_text'          => _x( 'Previous', 'previous post' ),
    			'next_text'          => _x( 'Next', 'next post' ),
    			'screen_reader_text' => __( 'Posts navigation' ),
    		) );
    
    		// Make sure we get a string back. Plain is the next best thing.
    		if ( isset( $args['type'] ) && 'array' == $args['type'] ) {
    			$args['type'] = 'plain';
    		}
    
    		// Set up paginated links.
    		$links = paginate_links( $args );
    
    		if ( $links ) {
    			$navigation = _navigation_markup( $links, 'pagination', $args['screen_reader_text'] );
    		}
    	}
    
    	return $navigation;
    }
    
    /**
     * Display a paginated navigation to next/previous set of posts,
     * when applicable.
     *
     * @since 4.1.0
     *
     * @param array $args Optional. See {@see get_the_posts_pagination()} for available arguments.
     *                    Default empty array.
     */
    function the_posts_pagination( $args = array() ) {
    	echo get_the_posts_pagination( $args );
    }
    Anonymous
    #51522
    This reply has been marked as private.
    Ross Moderator
    #51595
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 15 total)