Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Multiple filters on a page pagination problem

Tagged: 

Viewing 10 posts - 1 through 10 (of 16 total)
  • Paul Ksi
    #260420

    I have 5 filters on a page, i use them with shortcodes, when i click on pagination it only filters last one, how to make pagination unique??
    Thanks.

    Paul Ksi
    #260430

    `<?php
    /**
    * Search & Filter Pro
    *
    * Sample Results Filter News
    *
    * @package Search_Filter
    * @author Ross Morsali
    * @link https://searchandfilter.com
    * @copyright 2018 Search & Filter
    *
    * Note: these templates are not full page templates, rather
    * just an encaspulation of the your results loop which should
    * be inserted in to other pages by using a shortcode – think
    * of it as a template part
    *
    * This template is an absolute base example showing you what
    * you can do, for more customisation see the WordPress docs
    * and using template tags –
    *
    * http://codex.wordpress.org/Template_Tags
    *
    */

    // If this file is called directly, abort.
    if ( ! defined( ‘ABSPATH’ ) ) {
    exit;

    }

    ?>
    <div id=”site_post_feed”>
    <?php

    if ( $query->have_posts() )
    {
    ?>

    <?php

    while ($query->have_posts())
    {
    $query->the_post();

    ?>

    <div id=”site_post_feed_item”>
    <div id=”site_post_feed_item_featured_image”>
    <a href=”<?php echo get_the_permalink();?>”><?php echo get_the_post_thumbnail(); ?></a>
    </div>
    <div id=”site_post_feed_item_item_title”>
    <a href=”<?php echo get_the_permalink();?>”>
    <?php echo get_the_title() ?></a></div>
    <div id=”site_post_feed_item_item_excerpt”><a href=”<?php the_permalink() ?>”>
    <?php echo wp_trim_words( get_the_excerpt(), 20, $moreLink = null)?>
    </a></div>
    <div id=”site_post_feed_item_item_category”>

    <?php echo wpdocs_custom_taxonomies_terms_links(); ?>

    </div>
    <div id=”site_post_feed_item_date”>
    <a href=”‘<?php the_permalink() ?>”><?php echo get_the_date() ?></a>
    </div>
    </div>

    <?php
    }

    ?>

    <?php
    }
    else
    {
    // echo “No Results Found”;
    }
    ?>

    </div>
    <div class=”pagination”>
    <div class=”pagination” id=”site_pagination”></div>

    <?php
    /* example code for using the wp_pagenavi plugin */
    if (function_exists(‘wp_pagenavi’))
    {
    echo “<br />”;
    wp_pagenavi( array( ‘query’ => $query ) );
    }
    ?>

    </div>

    Paul Ksi
    #260431

    using shortcode tempaltes, please help, thanks

    Trevor Moderator
    #260505

    Are you able to send me a live link/URL to your search page so I can take a look?

    Can you also re-post that code, but inside code ticks (one before the code, one after)? On my UK Windows keyboard, the code tick key is next to the 1 key in the standard part of the keyboard. If you do this Google search and look at the images, they show various keyboards and where the key is located:

    https://www.google.com/search?q=back+tick+code+key

    Paul Ksi
    #260596
    <?php
    	/**
    		* Template Name: Education Page
    		*
    		* @package OceanWP WordPress theme
    	*/
    ?>
    <!DOCTYPE html>
    <html class="<?php echo esc_attr( oceanwp_html_classes() ); ?>" <?php language_attributes(); ?>>
    	<head>
    		<meta charset="<?php bloginfo( 'charset' ); ?>">
    		<link rel="profile" href="http://gmpg.org/xfn/11">
    		<?php wp_head(); 
    			get_header();
    		?>
    	</head>
    	<!-- Begin Body -->
    	<body <?php body_class(); ?> <?php oceanwp_schema_markup( 'html' ); ?>>
    		<?php wp_body_open(); ?>
    		<?php do_action( 'ocean_before_outer_wrap' ); ?>
    		<div id="outer-wrap" class="site clr">
    			<a class="skip-link screen-reader-text" href="#main"><?php oceanwp_theme_strings( 'owp-string-header-skip-link', 'oceanwp' ); ?></a>
    			<?php do_action( 'ocean_before_wrap' ); ?>
    			<div id="wrap" class="clr">
    				<?php do_action( 'ocean_before_main' ); ?>
    				<main id="main" class="site-main clr"<?php oceanwp_schema_markup( 'main' ); ?> role="main">
    					<?php do_action( 'ocean_before_content_wrap' ); ?>
    					<div id="content-wrap" class="container clr">
    						<?php do_action( 'ocean_before_primary' ); ?>
    						<section id="primary" class="content-area clr">
    							<?php do_action( 'ocean_before_content' ); ?>
    							<div id="content" class="site-content clr">
    								<!-- !-->
    								<div id="site_canvas" class="about_us_page">
    									<?php 
    										//echo is_user_logged_in();
    										// lang
    										echo "<div id='site_title_1' class='set_width_100'>".get_the_title()."</div>";
    									?>
    									
    									<div id="site_text" class="set_width_50">			
    										<?php echo do_shortcode('[pods name="settings_education" id="562"]{@settings_education_1}[/pods] '); ?>
    									</div>
    									<div id="site_img" class="set_width_50 set_padding_5">
    									</div>
    									
    								</div>
    								
    								<div id="site_canvas">
    									
    									
    									
    									
    									
    									<div id="filter_canvas" class="filter_2"> 
    										<div id="site_title_2" >
    											Edukacijos
    											
    										</div>
    										<div id="site_filter" >
    											<?php  echo do_shortcode("[searchandfilter id='17423']");  ?>
    										</div>
    										
    										
    									</div>
    									
    									<div id="site_break_line"></div>
    									
    									<?php  echo do_shortcode("[searchandfilter id='17423' show='results']");  ?>
    									
    									
    									
    								</div>
    								
    								
    								
    								<div id="site_canvas">
    									
    									
    									
    									
    									
    									<div id="filter_canvas"  class="filter_1"> 
    										<div id="site_title_2" >
    											Registracija į ekskursiją
    											
    										</div>
    										<div id="site_filter">
    											<?php  echo do_shortcode("[searchandfilter id='17516']");  ?>
    										</div>
    										
    										
    									</div>
    									
    									<div id="site_break_line"></div>
    									
    									<?php  echo do_shortcode("[searchandfilter id='17516' show='results']");  ?>
    									
    									
    									
    								</div>
    								
    								<div id="site_canvas" class="set_width_100 set_padding_top_20">
    									<div id="site_break_line" class="thinner"></div>
    								</div>
    								
    								
    								
    								
    								<div id="site_canvas" class="set_width_100 set_padding_top_20">
    									<div id="site-accordion" class="set_width_100">
    										<div class="tabs" class="set_width_100">
    											
    											
    											<div class="tab" onclick='this.scrollIntoView({ behavior: "smooth", block: "center"});'>
    												<input type="checkbox" id="chck2">
    												<label class="tab-label " for="chck2">Paskaitos</label>
    												<div class="tab-content set_background_color_2">
    													<div id="site_text" >
    														<?php echo do_shortcode('[pods name="settings_education" id="562"]{@settings_education_3}[/pods] '); ?>
    													</div>
    												</div>
    											</div>
    											
    											<div class="tab" onclick='this.scrollIntoView({ behavior: "smooth", block: "center"});'>
    												<input type="checkbox" id="chck3">
    												<label class="tab-label " for="chck3">Viktorinos</label>
    												<div class="tab-content set_background_color_2">
    													
    													
    													
    													<div id="site_canvas">
    														
    														
    														
    														
    														
    														<div id="filter_canvas"  class="filter_1"> 
    															<div id="site_title_2" >
    																
    																
    															</div>
    															<div id="site_filter">
    																<?php  echo do_shortcode("[searchandfilter id='17557']");  ?>
    															</div>
    															
    															
    														</div>
    														
    														<!--<div id="site_break_line"></div>-->
    														
    														<?php  echo do_shortcode("[searchandfilter id='17557' show='results']");  ?>
    														
    														
    														
    													</div>
    													
    													
    													
    												</div>
    											</div>
    											
    											<div class="tab" onclick='this.scrollIntoView({ behavior: "smooth", block: "center"});'>
    												<input type="checkbox" id="chck4">
    												<label class="tab-label " for="chck4">Konkursai</label>
    												<div class="tab-content set_background_color_2">
    													
    													
    													<div id="site_canvas">
    														
    														
    														
    														
    														
    														<div id="filter_canvas"  class="filter_1"> 
    															<div id="site_title_2" >
    																
    																
    															</div>
    															<div id="site_filter">
    																<?php  echo do_shortcode("[searchandfilter id='17571']");  ?>
    															</div>
    															
    															
    														</div>
    														
    														<!--<div id="site_break_line"></div>-->
    														
    														<?php  echo do_shortcode("[searchandfilter id='17571' show='results']");  ?>
    														
    														
    														
    													</div>
    													
    													
    												</div>
    											</div>
    											
    										</div>
    									</div>
    								</div>
    								<!-- !-->
    							</div>
    						</div>
    						<?php do_action( 'ocean_before_content_inner' ); ?>
    						<?php
    							while ( have_posts() ) :
    							the_post();
    						?>
    						<div class="entry-content entry clr">
    							<?php the_content(); ?>
    						</div><!-- .entry-content -->
    						<?php endwhile; ?>
    						<?php do_action( 'ocean_after_content_inner' ); ?>
    					</div><!-- #content -->
    					<?php do_action( 'ocean_after_content' ); ?>
    				</section><!-- #primary -->
    				<?php do_action( 'ocean_after_primary' ); ?>
    			</div><!-- #content-wrap -->
    			<?php do_action( 'ocean_after_content_wrap' ); ?>
    		</main><!-- #main-content -->
    		<?php do_action( 'ocean_after_main' ); ?>
    	</div><!-- #wrap -->
    	<?php do_action( 'ocean_after_wrap' ); ?>
    </div><!-- .outer-wrap -->
    <?php do_action( 'ocean_after_outer_wrap' ); ?>
    <?php wp_footer(); 
    	get_footer();
    ?>
    </body>
    </html>
    Paul Ksi
    #260598

    Sorry but i cant give you login now, i`ll try to set up a demo site then,

    this is a very simple case filters as shortcodes 4 of them on a site, thats it

    Paul Ksi
    #260600

    each filter template is pretty much the same

    <?php
    	/**
    		* Search & Filter Pro 
    		*
    		* Sample Results Filter News
    		* 
    		* @package   Search_Filter
    		* @author    Ross Morsali
    		* @link      https://searchandfilter.com
    		* @copyright 2018 Search & Filter
    		* 
    		* Note: these templates are not full page templates, rather 
    		* just an encaspulation of the your results loop which should
    		* be inserted in to other pages by using a shortcode - think 
    		* of it as a template part
    		* 
    		* This template is an absolute base example showing you what
    		* you can do, for more customisation see the WordPress docs 
    		* and using template tags - 
    		* 
    		* http://codex.wordpress.org/Template_Tags
    		*
    	*/
    	
    	// If this file is called directly, abort.
    	if ( ! defined( 'ABSPATH' ) ) {
    		exit;
    		
    		
    		
    	}
    	
    	
    ?>
    <div id="site_post_feed">
    	<?php
    		
    		if ( $query->have_posts() )
    		{
    		?>
    		
    		
    		
    		<?php
    			
    			while ($query->have_posts())
    			{
    				$query->the_post();
    				
    			?>
    			
    				<div id="site_post_feed_item">
    					<div id="site_post_feed_item_featured_image">
    						<a href="<?php echo get_the_permalink();?>"><?php echo get_the_post_thumbnail(); ?></a>
    					</div>
    					<div id="site_post_feed_item_item_title">
    						<a href="<?php echo get_the_permalink();?>">
    						<?php echo get_the_title() ?></a></div>
    						<div id="site_post_feed_item_item_excerpt"><a href="<?php the_permalink() ?>">
    							<?php echo wp_trim_words( get_the_excerpt(), 20, $moreLink = null)?>
    						</a></div>
    						<div id="site_post_feed_item_item_category">
    							
    							
    							<?php echo wpdocs_custom_taxonomies_terms_links(); ?>
    							
    							
    						</div>	
    						<div id="site_post_feed_item_date">
    							<a href="'<?php the_permalink() ?>"><?php echo get_the_date() ?></a>
    						</div>
    				</div>	
    		
    			
    			<?php
    			}
    			
    			
    		?>
    		
    		
    		
    		<?php
    		}
    		else
    		{
    			//	echo "No Results Found";
    		}
    	?>
    	
    </div>
    <div class="pagination">
    	<div class="pagination" id="site_pagination"></div>	
    	
    	<?php
    		/* example code for using the wp_pagenavi plugin */
    		if (function_exists('wp_pagenavi'))
    		{
    			echo "<br />";
    			wp_pagenavi( array( 'query' => $query ) );
    		}
    	?>
    	
    </div>
    Paul Ksi
    #260670

    When you click on a filter and select another category then pagination works i`m assuming on load it looses focus, and starts focus pagination only on the last filter??

    Trevor Moderator
    #260857

    From the template code, you appear to have more than one form on the same results page? If you do, this will not work.

    Paul Ksi
    #260923

    Yes there are 4 forms, so basically you can`t put 4 different filters and show different results in each div on the same page?

    basically its like this :

    [searchandfilter id=’17516′]
    [searchandfilter id=’17516′ show=’results’]

    [searchandfilter id=’17517′]
    [searchandfilter id=’17517′ show=’results’]

    [searchandfilter id=’17518′]
    [searchandfilter id=’17518′ show=’results’]

    [searchandfilter id=’17519′]
    [searchandfilter id=’17519′ show=’results’]

Viewing 10 posts - 1 through 10 (of 16 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.