-
AuthorSearch Results
-
October 17, 2016 at 10:15 am #64374
In reply to: drop down filter(auto count) not working properly?
TrevorParticipantHi
It all seems to work for me?
As to not showing results when the page loads, you need to edit the results.php file, like this:
global $searchandfilter; $sf_current_query = $searchandfilter->get(1726)->current_query(); if (!$sf_current_query->is_filtered()) { // put anything you want instead of the results for the page loading without query parameter } else { // put the output part of the results.php here }October 15, 2016 at 10:02 am #64173In reply to: Show results in grid
TrevorParticipantOK. This is the complete, revised results.php:
<?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 * */ 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="gp-blog-wrapper gp-blog-columns-3"> <div class="gp-inner-loop ajax-loop"> <?php while ($query->have_posts()) { $query->the_post(); ?> <section class="gp-post-item post-<?php get_the_id();?> post type-post format-standard has-post-thumbnail category-post-formats" itemscope="" itemtype="http://schema.org/Blog"> <div class="gp-post-thumbnail gp-loop-featured"> <div class="gp-image-above"> <a href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail("small", array('class' => 'gp-post-image gp-large-image')); the_post_thumbnail("thumb", array('class' => 'gp-post-image gp-mobile-image')); } ?> </a> </div> </div> <div class="gp-loop-content gp-image-above"> <h2 class="gp-loop-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <div class="gp-loop-text"> <?php the_excerpt(); ?> </div> </div> <div class="gp-loop-meta"> <span class="gp-post-meta gp-meta-author"> <?php the_author_link(); ?> </span> <time class="gp-post-meta gp-meta-date" datetime="<?php the_date();?>"> <?php the_date(); ?> </time> </div> </section> <?php } ?> </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"; } ?>The posts all need featured images, many do not have them. It would also be a good idea to make manual excerpts for them all, as your theme seems to leave the excerpt very long 🙁
October 15, 2016 at 9:33 am #64167In reply to: filter posts type
TrevorParticipantOK
I think the issue was the results URL. You had copied the URL from the browser URL bar, but that includes encoded characters. If you edit the page instead, and get the permalink from there, it has the correct unencoded Hebrew characters. If you look now at the search form setup, you will see that the results url is now correct. The search does now work, but the results.php template is being used, so it is not so pretty, but you can edit that to change it.
October 14, 2016 at 3:52 pm #64089In reply to: Custom search filter
TrevorParticipantBonjour François
You want the results in 3 columns?
Using the shortcode method you can modify the results.php template to your needs. You must first make a copy in your theme folder:
If you have an example from your theme of an archives page that looks the same?
October 14, 2016 at 3:22 pm #64076In reply to: filter posts type
AnonymousInactiveno i didn’t modified the results.php, and yes, the results look different. and look, it’s show me the results at the start
http://children.tempurl.co.il/%D7%93%D7%99%D7%95%D7%95%D7%97-%D7%9B%D7%A1%D7%A4%D7%99/October 14, 2016 at 3:19 pm #64074In reply to: filter posts type
TrevorParticipantThe
Results URLfield should have the full URL of the page, yes, and the results shortcode should be on the page. But I think the results will then look different, unless you have already modified the results.php template file?October 14, 2016 at 9:59 am #63936In reply to: Show results in grid
TrevorParticipantHi Maxime
That layout can be recreated in Search & Filter Pro’s results.php file IF you are using the Shortcode Display results method, as you are. The first step is to make a custom copy of this results.php file. Please read here:
The next step is to edit that file and replace this section:
<div> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p> <br /> <?php the_excerpt(); ?> </p> <?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail( "small"); echo '</p>'; } ?> <p> <?php the_category(); ?> </p> <p> <?php the_tags(); ?> </p> <p><small><?php the_date(); ?></small> </p> </div> <hr />With this:
<section class="gp-post-item post-<?php get_the_id();?> post type-post format-standard has-post-thumbnail category-post-formats" itemscope="" itemtype="http://schema.org/Blog"> <div class="gp-post-thumbnail gp-loop-featured"> <div class="gp-image-above"> <a href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( "small", array( 'class'=> 'gp-post-image gp-large-image')); the_post_thumbnail("thumb", array('class' => 'gp-post-image gp-mobile-image')); } ?> </a> </div> </div> <div class="gp-loop-content gp-image-above"> <h2 class="gp-loop-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <div class="gp-loop-text"> <?php the_excerpt(); ?> </div> </div> <div class="gp-loop-meta"> <span class="gp-post-meta gp-meta-author"> <?php the_author_link(); ?> </span> <time class="gp-post-meta gp-meta-date" datetime="<?php the_date();?>"> <?php the_date(); ?> </time> </div> </section>I cannot guarantee that this will work. It may require some more editing. The read more might require more work to be right for you. On the time part, I have omitted the perfectly correct timestamp from inside the tag, as that would mean I would have to be able to experiment to get that right from within your server. Not something I want to do. You might be able to figure this by doing a recursive search for the key phrase
datetime=on the theme files to discover the php that needs to go in between the quotes that I have put<?php the_date();?>in for nowOctober 12, 2016 at 9:00 am #63450In reply to: ACF and CPT output
TrevorParticipantmythemename/search-filter/templates/results.phpshould be
mythemename/search-filter/results.phpThe other (
mythemename/search-filter-pro/templates/results.php) is simply wrong and would not be used. It is covered in the documentation here:October 11, 2016 at 10:44 pm #63425In reply to: ACF and CPT output
AnonymousInactiveI got my results themed by altering the plugins/search-filter-pro/templates/results.php file, but this is not ideal. I have created mythemename/search-filter-pro/templates/results.php and mythemename/search-filter/templates/results.php but neither of these is being loaded.
If you have a url where any of this is explained, it would be appreciated.
In the meantime, I did get a custom field, named location, wrapped by adding this to results.php in the plugin folder:
<div class="customtest"><?php the_field('location'); ?></div>October 11, 2016 at 3:12 pm #63303In reply to: ACF and CPT output
TrevorParticipantUsing templates from your theme, as Post Type Archive and As an Archive methods do, means you have to edit the template files and add the php yourself. ACF has examples on its own site.
If you use the Shortcode method, then that uses our own results.php template (you make a copy for your theme) and then it is easy for me to show you how, if I haven’t already posted examples for Avada users (do a quick search for
avada results.php). -
AuthorSearch Results