Forums Forums Search & Filter Pro Filter issue: Results are showing without even filters are applied.

Viewing 10 posts - 61 through 70 (of 71 total)
  • Anonymous
    #85403
    This reply has been marked as private.
    Anonymous
    #85440
    This reply has been marked as private.
    Trevor
    #85444

    I can put it back how I had left it?

    Anonymous
    #85448

    Yes you can 🙂 and don’t forget to fix that the form is only filtering 4 posts in total when you filter posts by author. But author “jooobs” have published 10 posts. Then why is it filtering only 4 posts. When you fix the result.php, you can check it by choosing author only and you will understand what i actually mean. Only 4 posts will show.

    Trevor
    #85727

    I am logging in to your site now.

    Trevor
    #85731

    Just in case this happens again, this is the code I wrote:

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      http://www.designsandcode.com/
     * @copyright 2015 Designs & Code
     * 
     * 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
     *
     */
    
    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(5048)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo ''; 
    } else {
    	
    	if ( $query->have_posts() )
    {
    	?>
    	
    	Found <?php echo $query->found_posts; ?> Results<br />
    	Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	
    	<div class="pagination">
    		
    		<div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
    		<?php
    			/* example code for using the wp_pagenavi plugin */
    			if (function_exists('wp_pagenavi'))
    			{
    				echo "<br />";
    				wp_pagenavi( array( 'query' => $query ) );
    			}
    		?>
    	</div>
    <div class="slz-shortcode sc_block_posts "><div class="slz-template-03 ">
    	<div class="slz-list-block slz-column-2">
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    		<div class="item">
    			<div class="slz-block-item-01 style-1">
    			<?php if ( has_post_thumbnail() ) {?>
    					<div class="block-image">
         <a href="<?php the_permalink(); ?>" class="link">
          <?php the_post_thumbnail("full", array( 'class' => 'img-responsive' ));?>
    					</a>
        </div>
    			<?php } ?>
        <div class="block-content">
         <div class="block-content-wrapper">
    			   <a class="block-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    						<ul class="block-info">
    							<li><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><span class="author-label">By </span><span class="author-text"><?php the_author(); ?></span></a></li>
    						 <li><a href="<?php the_permalink(); ?>" class="link date"><?php the_date(); ?></a></li>
    						 <li><a href="<?php the_permalink(); ?>#comments" class="link comment"><?php comments_number();?></a></li>
           <li><a href="<?php the_permalink(); ?>" class="link view">?? Views</a>
                            </li>
    						 <li><?php the_category(); ?></li>
    						</ul>
    						<div class="block-text"><?php echo get_the_excerpt(); ?></div>
    
    			  </div>
    		  </div>
    			
    			</div>
    		</div>
    		
    		<?php
    	}
    	?>
    	</div>
    	</div></div>
    
    	Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	
    	<div class="pagination">
    		
    		<div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
    		<?php
    			/* example code for using the wp_pagenavi plugin */
    			if (function_exists('wp_pagenavi'))
    			{
    				echo "<br />";
    				wp_pagenavi( array( 'query' => $query ) );
    			}
    		?>
    	</div>
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    }
    ?>
    Trevor
    #85735

    I have edited it back now.

    Trevor
    #85737

    The reason why it shows only four posts is that in the Tags, Categories & Taxonomies settings you have told it to only include posts that have a Format of 205, 197, 202 and 204 and so any post NOT having these is excluded.

    Trevor
    #85741

    Using these includes and excludes is both powerful and dangerous. It is a good way to exclude posts that have no values in these, but if you want to exclude others that have values, it is better to use them as excludes.

    Anonymous
    #85756
    This reply has been marked as private.
Viewing 10 posts - 61 through 70 (of 71 total)