Forums › Forums › Search & Filter Pro › Easy way to filter all posts?
Tagged: results
- This topic has 16 replies, 2 voices, and was last updated 6 years, 5 months ago by Anonymous.
-
Anonymous(Private) June 5, 2018 at 9:36 am #179707
Got it! Went as far as replacing the title PHP but it brings back the site title instead of the page title..
<?php
wp_title(‘<h1 class=”page-title”>’, ‘</h1>’);
?>Guess I’m using the wrong function.
Also how do I show the number of results on the page? It was showing using the shortcode but not with the archive page.
Is it also possible to show numbers next to the filters (eg. filtername (2) )?
Trevor(Private) June 5, 2018 at 9:46 am #179713You don’t need a function in there at all.
You can simply put this:
<header class="page-header"> <h1 class="page-title">Search Results</h1> </header><!-- .page-header -->
As for placing the search terms, that is a little harder. It would have to be done by your theme, or in that template. You can look at how we do it (for the Shortcode method) in the file results.php found in the plugin’s template folder, and also see this documentation:
https://searchandfilter.com/documentation/accessing-search-data/
Note that when the results update using Ajax, the search terms can only update if the method that you use to show these is inside the code that makes the id=”main” section of the page.
Anonymous(Private) June 5, 2018 at 11:11 am #179725OK – used a static title. Re the number of results I’ve copied the code from results.php but it doesn’t return the number:
<?php if ( have_posts() ) : ?>
<header class=”page-header”>
<h1 class=”page-title”>My Title</h1>’
</header><!– .page-header –>Found <?php echo $query->found_posts; ?> Results<br />
Page <?php echo $query->query[‘paged’]; ?> of <?php echo $query->max_num_pages; ?>And for the search term I meant “is possible to show the numbers next to the filters (on the search form)?” rather than on the results page.
-
AuthorPosts