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 Problem with pagination

Viewing 10 posts - 1 through 10 (of 11 total)
  • Tomasz
    #129359

    I don’t know why but pagination always shows 1 of X. Even though it loads another page content, the url changes and still – it shows 1 of X and the “1” is selected.

    Can anyone help please?

    The url is: http://newpage.lobohr.pl/

    Trevor Moderator
    #129448

    It is because your pagination (code) is outside of the results template code. That means that Ajax is not refreshing it. Move it inside the results.php template.

    Tomasz
    #129598

    Thanks for your reply Trevor. Can you help me, because now after choosing a page whole section disappears?

    results.php code as follows:

    
    <?php
    if ( $query->have_posts() )
    {
    	?>
    
    <table width="100%" border="0" cellpadding="10">
      <tbody>
        <tr class="naglowki-tabeli">
          <th scope="col">DATA PUBLIKACJI</th>
          <th scope="col"><strong>STANOWISKO</strong></th>
          <th scope="col">LOKALIZACJA</th>
          <th scope="col">WYNAGRODZENIE BRUTTO</th>
          <th scope="col">&nbsp;</th>
        </tr>
    	
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    
    		<tr class="pojedynczy-wynik-tabeli">
    			  <td><?php echo (new \DateTime($query->post->post_date))->format('Y-m-d'); ?></td>
    			  <td><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td>
    			  <td><?php echo get_post_meta($query->post->ID,"lokalizacja",true); ?></td>
    			  <td><?php echo get_post_meta($query->post->ID,"wynagrodzenie_brutto",true); ?></td>
    		  <td><a href="<?php the_permalink(); ?>">ZOBACZ</a></td>
    		</tr>
    
    		<?php
    	}
    	?>	
    
      </tbody>
    </table> 
    	
    	<div class="pagination"><?php wp_pagenavi(); ?></div>
    
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    ?>
    
    Trevor Moderator
    #129677

    For the pagination code, look in our plugin folder, find the templates folder, in that open the results.php in an editor and you will see a good example of how to do it. If that is what you di, my apologies. Don’t forget that it needs to access the query, to be able to count the results.

    Tomasz
    #129777

    Hi Trevor, thank you once again for your reply!

    Yes that was the results.php code above. Could you please be more specific about how can it access the query? I’m sorry I’m not that “fluent” in PHP.

    Trevor Moderator
    #129812

    Could you post the entire results.php file that you are using? I assume that the part you posted above is not all of it?

    Tomasz
    #129837

    Actually it’s everything.

    And on the Homepage Template is called with this code:

    
    <?php echo do_shortcode( '[searchandfilter id="12"]' ); ?>
    <?php echo do_shortcode( '[searchandfilter id="12" show="results"]' ); ?>
    Trevor Moderator
    #129921

    You have this:

    <div class="pagination"><?php wp_pagenavi(); ?></div>
    

    But our template shows this:

    <div class="pagination">
    <?php
    if (function_exists('wp_pagenavi')) {
      wp_pagenavi( array( 'query' => $query ) );
    }
    ?>
    </div>

    Is there a reason why you did not use that?

    Tomasz
    #130361

    Thank you Trevor! That was the issue and now it works great on the homepage.

    Last thing – I used the same code on a different page and when I click on a pagination i.e. “2” the whole page reloads and jumps to the top, do you know why?
    Even when I duplicated the code I got the same issue.

    Here is the link to the page

    Tomasz
    #130365

    Sorry Trevor, it’s probably just how this plugin works once you remove the filtering line and leave just the results right?

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

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