Forums › Forums › Search & Filter Pro › Filter issue: Results are showing without even filters are applied.
- This topic has 70 replies, 2 voices, and was last updated 7 years, 10 months ago by Trevor.
-
Anonymous(Private) January 25, 2017 at 6:57 pm #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(Private) January 26, 2017 at 2:55 pm #85731Just 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"; } } ?>
-
AuthorPosts