AnonymousInactive
Hi! Please someone give me help. I want to give the results.php order by name and ASC. My code is:
<?php
if ( $query->have_posts() )
{
?>
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<p><?php the_content(); ?><p>
</div>
<?php
}
?>
Thanks!
AnonymousInactive
Ok I have set the plugin to not use my custom template, and it seems to be pulling the correct results. However, I am not sure what template it is using now. In the /templates folder, editing the results.php does not seem to cause any changes…
AnonymousInactive
Hi
I’m trying to use the shortcode option for displaying results but only get results for text searches not searches by category.
I’m using the default results.php file at this stage that I have copied from the templates folder and put inside a folder called search-filter
http://ibmiotdir.staging.wpengine.com/find-a-start-up
I wondered if my problem might be the same as #46499.
I can provide a log into this staging area if that would be useful.
Can you help please?
Jayson
OK
I can see that the results are in the format of the results.php template that we provide, which means that you are using the shortcode Display result method? The URL you gave shows 135 results found?
I searched in ‘Class Categories’ for Brahma Samhita and it finds one result.
Hi Carole
The ACF fields are called Post Meta and so you must drag and drop that to the form builder. In there you will see a checkbox to say it is an ACF field.
Also, when selecting the field you want, make sure the name starts without an underscore.
Styling and the appearance of the results depends on the Display Results Method you choose. ‘As and Archive’ and ‘Post Type Archive’ depend on your theme templates. You may have to edit those templates to add the ACF fields. If you are able (if your theme supports and works with it) to use the Shortcodes display result method, then that uses its own results.php template, and things are a lot more flexible.
AnonymousInactive
Hi,
I’ve upgraded to the latest ver. 2.1.2 on my test site and the search results page displays now NO RESULTS FOUND.
Need you help to troubleshoot the reason.
First I thought it’s my custom search results template I use inside /my-theme/search-filter/results.php
I replaced it with a default file from /search-filter-pro/templates/. Same result. There must be something else.
Can you help?
My test page is http://rsdasa.5notedesign.com/find-a-class/
And I will provide login details upon request.
Thank you,
Dmitriy
You appear to be using the shortcode results method, so that is good. Did you make a copy of results.php and place it in a folder called search-filter in your theme folder?
If so, find this code block:
<?php
if ( has_post_thumbnail() ) {
echo '<p>';
the_post_thumbnail("small");
echo '</p>';
}
?>
and make it this (I think):
<?php
if ( has_post_thumbnail() ) {
echo '<a href="' . the_permalink() . '">';
the_post_thumbnail("small");
echo '</a>';
}
?>
Got the files. I will post the results.php here for others to use if they wish, with their copy of Ignition and Thrive Visual Builder:
<?php
/**
* Search & Filter Pro
*
* Sample Thrive Results Template
*
* @package Search_Filter
* @author Trevor Nelmes
* @link http://www.designsandcode.com/
* @copyright 2016 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; ?> Cars<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( 'Previous Page of Cars', $query->max_num_pages ); ?></div>
<div class="nav-next"><?php previous_posts_link( 'Next Page of Cars' ); ?></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="thrv_wrapper thrv_post_grid" data-unit="px">
<div class="tve_post_grid_wrapper tve_clearfix tve_post_grid_grid">
<div style="display: flex; flex-wrap: wrap;" class="tve_pg_row tve_clearfix">
<?php
$thrive_counter = 0;
$thrive_row_counter = 0;
while ($query->have_posts())
{
if ( $thrive_counter == 0 ) && ( $thrive_row_counter > 0 ) {
?>
</div>
<div style="display: flex; flex-wrap: wrap;" class="tve_pg_row tve_clearfix">
<?php
}
$query->the_post();
?>
<div class="tve_post tve_post_width_5 " style="align-items: stretch;">
<div class="tve_pg_container">
<?php
if ( has_post_thumbnail() ) {
$thrive_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'single-post-thumbnail' );
?>
<a href="<?php the_permalink(); ?>">
<div class="tve_post_grid_image_wrapper" style="background-image: url('<?php echo $thrive_image[0]; ?>')">
<div class="tve_pg_img_overlay">
<span class="thrv-icon thrv-icon-forward"></span>
</div>
</div>
</a>
<?php
}
?>
<span class="tve-post-grid-title " style="font-size: 18px;line-height: 20px;font-family:'Arial', 'Helvetica', 'sans-serif';">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</span>
<div class="tve_pg_more" data-tve-custom-colour="62938813">
<a href="<?php the_permalink(); ?>">View Now</a>
<span class="thrv-icon thrv-icon-uniE602"></span>
</div>
</div>
</div>
<?php
$thrive_counter++;
if ( $thrive_counter > 4 ) {
$thrive_counter = 0;
$thrive_row_counter++;
}
}
?>
</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( 'Previous Page of Cars', $query->max_num_pages ); ?></div>
<div class="nav-next"><?php previous_posts_link( 'Next Page of Cars' ); ?></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";
}
?>
Note that this search was for Cars for Sale, so some text strings have been modified to suit (like in the number of results and pagination).
AnonymousInactive
Hi Trevor,
thanks to your excellent guidance and explanations.
The results.php is working now as intended.
check out: https://www.kleinkunst.theater/
Pls note that I have translated some words into german.
(not yet internationalised code, but will add that as well)
<?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() )
{
?>
<?php echo $query->found_posts; ?> Beiträge gefunden<br />
Seite <?php echo $query->query['paged']; ?> von <?php echo $query->max_num_pages; ?><br />
<div class="pagination">
<div class="nav-previous"><?php next_posts_link( 'Ältere Beiträge', $query->max_num_pages ); ?></div>
<div class="nav-next"><?php previous_posts_link( 'Neuere Beiträge' ); ?></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="row row-masonry">
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<article <?php post_class('post-masonry col-sm-' . $grid_col); ?>>
<div class="post-inner">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php echo at_post_thumbnail($post->ID, 'at_thumbnail', $args); ?>
</a>
<h2>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a>
</h2>
<p><?php echo the_excerpt(); ?></p>
<div class="clearfix"></div>
</div>
</article>
<?php
}
?>
</div>
Seite <?php echo $query->query['paged']; ?> von <?php echo $query->max_num_pages; ?><br />
<div class="pagination">
<div class="nav-previous"><?php next_posts_link( 'Ältere Beiträge', $query->max_num_pages ); ?></div>
<div class="nav-next"><?php previous_posts_link( 'Neuere Beiträge' ); ?></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";
}
?>
So, that was a good Skype session, Frank.
When you have finished what I have started for you customizing the results.php file, maybe you can post it here for others to see?
If you feel that this support has been worthy of note, maybe you could leave a review:
http://www.designsandcode.com/wordpress-plugins/search-filter-pro/reviews/