Forums Forums Search & Filter Pro Numeric Pagination with results.php

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #89027

    I have poked around the forums and documentation to try to find an answer to this, but could not find anything – please direct me to and former posts that I have overlooked!

    I have the Search & Filter Pro plugin set up, and have a search form set up that loads results with ajax. I am using the shortcode method, so I have the form shortcode in a sidebar widget, and the results shortcode in the body of my page. Everything works great, I really like this plugin!

    I am overriding results.php in my_theme/search-filter/results.php which works. The theme I am using is a child of _tk (by theme kraft). The theme has its own bootstrap numeric pagination function built in, which works great on my regular site search results page (using the theme’s search.php template), but when I attempt to call that function into the results.php template, nothing shows up. Here is my code in results.php:

    if ( $query->have_posts() )
    {
    	?>
    	Found <?php echo $query->found_posts; ?> Results <br/>
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    		<div>
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    			
    			<p><br /><?php the_excerpt(); ?></p>
    			<?php 
    				if ( has_post_thumbnail() ) {
    					echo '<p>';
    					the_post_thumbnail("small");
    					echo '</p>';
    				}
    			?>		
    		</div>
    		
    		<hr />
    		<?php
    	}
    	?>
    	Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	<div class="pagination">
    		<div class="numeric"><?php _tk_pagination($query->max_num_pages); ?
    	</div>
    
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }

    Any thoughts on why this might not be working? I can provide the url if that is needed. I can also provide the theme’s pagination function code if that is needed.

    Anonymous
    #89029
    This reply has been marked as private.
    Anonymous
    #89032

    Alternatively, is there a method with this plugin for displaying the pagination numerically? I am also open to just theming it if using my theme’s pagination function proves too crufty.

    Anonymous
    #89040

    I ended up resolving this on my own using wp-pagenavi plugin and some minor js hacks! This can be closed!

    The code (for anyone interested):

    <?php
    			/* example code for using the wp_pagenavi plugin */
    			if (function_exists('wp_pagenavi'))
    			{
    				echo "<br />";
    				wp_pagenavi( array( 'query' => $query, 'wrapper_class' => 'pagination pge-search', 'wrapper_tag' => 'ul' ) );
    			}
    		?>
    Trevor
    #89058

    The sun is just rising here (not that I can see it behind the usual clouds in the UK), and I see you have resolved this yourself whilst our support was closed. Thanks for posting your solution 🙂

Viewing 5 posts - 1 through 5 (of 5 total)