-
Search Results
-
Topic: infinite
Hello!
I have repeated results, both in infinite scroll and in results with normal pagination type. I made the web a couple of years ago, and created a file for the results that is this:
<?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 * */ ?> <div class="sections_group"> <div class="section "> <div class="section_wrapper clearfix"> <div class="column one column_blog"> <div class="blog_wrapper isotope_wrapper"> <?php if ( $query->have_posts() ) { ?> <div style="clear: both;"> <h4 style="font-weight: bold; text-align: center;"><?php echo $query->found_posts; ?> cursos encontrados</h4> <!--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> <div class=" <div class="search-filter-results"> "> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class="post-item isotope-item clearfix post type-post status-publish format-standard has-post-thumbnail hentry "> <div class="image_frame post-photo-wrapper scale-with-grid image" style="margin-bottom: 0 !important;"> <div class="image_wrapper"><a href="<?php the_permalink(); ?>"> <div class="mask"></div> <img width="960" height="502" src="<?php the_post_thumbnail("small"); ?>" class="scale-with-grid wp-post-image" alt="<?php the_title(); ?>"></a> </div> </div> <div class="post-desc-wrapper"> <div class="post-desc"> <div class="post-head"> <!--<div class="post-meta clearfix"> <div class="author-date"><span class="vcard author post-author"><span class="label">Publicado por </span><i class="icon-user"></i> <span class="fn"><?php the_author(); ?></span></span> </div> </div>--> </div> <div class="post-title"> <h4 class="entry-title" itemprop="headline"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> </div> </div> </div> </div> <?php } ?> <div style="clear: both;"> <div class="pagination"> <div style="text-align: center; font-weight: bold;"><span class="nav-previous"><?php previous_posts_link( '< ANTERIOR'); ?></span> <strong>Página <?php echo $query->query['paged']; ?> de <?php echo $query->max_num_pages; ?></strong> <span class="nav-next"><?php next_posts_link( 'SIGUIENTE >', $query->max_num_pages ); ?></span></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> </div> <?php } else { echo '<h4 style="font-weight: bold; text-align: center;">No hay más cursos para los criterios indicados.</h4>'; echo '<p style="font-weight: bold; text-align: center;"><a href="#" class="search-filter-reset" data-search-form-id="2889" data-sf-submit-form="always">Reiniciar filtros y mostrar todos los cursos.</a></p>'; } ?> </div> </div> </div> </div> </div> </div>
the web is http://www.sweetit.es/cursos
with the view normal pagination type it looks like this
https://www.sweetit.es/wp-content/uploads/2020/02/pagination-type-normal-page-01.jpeg
https://www.sweetit.es/wp-content/uploads/2020/02/pagination-type-normal-page-02.jpegwith the view without scroll
https://www.sweetit.es/wp-content/uploads/2020/02/pagination-type-infinite-scroll.jpegIf I put results per page 300 (total) does not repeat any results.
I don’t know how to make the results look good, can you help me? If you need more information, you can write to me at sweetit@sweetit.es
Thank you!Hello –
Do you know what I’m doing wrong here?
I’m trying to display the two below ACF custom fields in my search results, but they don’t show up. What is the correct way to display them?Thanks!
name: employer Type: Relationship
name: salary Type: Text<?php the_field(’employer’); ?>
<?php the_field(‘salary’); ?>—-
<?php
/**
* Search & Filter Pro
*
* Sample Results Template
*
* @package Search_Filter
* @author Ross Morsali
* @link https://searchandfilter.com
* @copyright 2018 Search & Filter
*
* 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() )
{
?><h5 style=”#70757a”>Found <?php echo $query->found_posts; ?> Results<br /></h5>
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
while ($query->have_posts())
{
$query->the_post();?>
<div class=”job-search-results”>
<h2>“><?php the_title(); ?></h2>
<?php
if ( has_post_thumbnail() ) {
echo ‘<p>’;
the_post_thumbnail(“small”);
echo ‘</p>’;
}
?>
<div class=”search-results-employer”><h5>Employer Name: <?php the_field(’employer’); ?> </h5></div>
<div class=”search-results-employer”><h5>Salary: <?php the_field(‘salary’); ?> </h5></div>
<div class=”search-results-location”><h5><?php the_terms( 0, ‘city’); ?>, <?php the_terms( 0, ‘job_country’); ?></h5></div>
<div class=”search-results-skills”><h5>Skills: <?php the_terms( 0, ‘job_expertise’); ?> </h5></div>
<div class=”search-results-date”><h5><small><?php the_date(); ?></small></h5></div>
</div><hr />
<?php
}
?>
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”;
}
?>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”;
}
?>