Forums › Forums › Search & Filter Pro › Customizing Results Using Templates
- This topic has 5 replies, 2 voices, and was last updated 5 years, 2 months ago by Trevor.
-
Anonymous(Private) September 3, 2019 at 7:56 pm #220223
Hi Trevor
I’d like my results to all display the same sized images, and/or when they float left, to snug up to the result box above it instead of leaving awkward spaces. I tried using a plugin to create a new image size ‘homepage-thumb’ and regenerated the images. Then I put that into the template file which I have pasted below.
Thanks in advance for your help! Let me know if there is anything else you need.Here is my results page: https://nbgqa.com/project-gallery/
Template code (wp-content / themes / headway / search-filter / 1922.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() )
{
?><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=”results-container”>
<?php
while ($query->have_posts())
{
$query->the_post();?>
<div class=”result-box”>
“>
<?php
if ( has_post_thumbnail() ) {
echo ‘<p>’;
the_post_thumbnail(“homepage-thumb”);
echo ‘</p>’;
}
?>
<h2>“><?php the_title(); ?></h2>
<h3 class=”post-excerpt”><?php the_excerpt(); ?></h3></div>
<?php
}
?>
</div><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”;
}
?>Anonymous(Private) September 4, 2019 at 2:25 am #220227I figured some things out here. Sorry for the pre-mature support request. I figured out that the problem wasn’t with my results.php code, but with the plug-in I was using to regenerate the image sizes. I got a new one and now the page is looking great with some css additions.
-
AuthorPosts