AnonymousInactive
The full results code… `<?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>
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<div class=”results-inline-search”>
<?php
global $post;
$pod_name = ‘Promotions’;
//get pods object
$pods = pods( $pod_name, $post->ID );
echo $pods->template(“my_search_loop”);
?>
</div>
<?php
}
?>
<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>
<?php
}
else
{
echo “No Results Found”;
}
?>`
AnonymousInactive
Hi, thanks for coming back to me.
For one of the custom results.php files I have used the infinite scroll version, my code looks like this (below).
I have also used a form without a custom results.php file, so it should have used the standard results.php file stored within the plugin.
<?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="filter-grid">
<div class='search-filter-results-list'>
<?php
while ($query->have_posts())
{
$query->the_post();
$thumb_url = get_post_meta( get_the_ID(), 'news_thumbnail', true );
$link = get_post_meta( get_the_ID(), 'news_link', true );
if ( empty($link) ) {
$link = get_the_permalink();
}
?>
<div class="x-column x-sm x-1-3 item">
<div class="category"><?php echo get_the_term_list(get_the_ID(), 'news', '', ', ', ''); ?></div>
<a href="<?php echo $link; ?>">
<div class="image">
<img src="<?php echo $thumb_url; ?>" width="100%" />
</div>
<div class="content">
<h3><?php the_title(); ?></h3>
<p><?php echo get_the_date( 'd.m.y' ); ?></p>
</div>
</a>
</div> <!-- .item -->
<?php
}
?>
</div> <!-- .search-filter-results-list -->
</div> <!-- #filter-grid -->
<?php
}
else
{
?>
<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
<span>End of Results</span>
</div>
<?php
}
?>
You will need to follow the instructions for making a custom results.php file here:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results
However, you need to change the contents of the standard results.php file to the content of the infinite scroll version, which look like 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
*
*/
if ( $query->have_posts() )
{
?>
Found <?php echo $query->found_posts; ?> Results<br />
<div class='search-filter-results-list'>
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<div class='search-filter-result-item'>
<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>
<hr />
</div>
<?php
}
?>
</div>
<?php
}
else
{
?>
<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
<span>End of Results</span>
</div>
<?php
}
?>
AnonymousInactive
Hello,
Infinite scroll seems to no longer be working. Here is the code I’m using for the results page which I customized and got the base from results-infinite-scroll.php. I have the file in my child theme in a folder titled “search-filter”. The custom results are showing but infinite scroll is a no go. Please advise. I already deactivated all plugins and even switched my theme over to twenty seventeen to test and infinite scroll does nothing. It was working a few weeks back showing the loader animation and then showing more results. My site is blocked inside a a firewall and cannot share the URL but my code for the results page is below.
<?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 />
<div class='search-filter-results-list'>
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<div class='search-filter-result-item'>
<!--MMC - Start custom results code -->
<div class="resource-wrap">
<div class="resource-tab">
<?php $terms = get_the_terms( $post->ID , ( 'resource_type' ) );
// init counter
$i = 1;
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, ( 'resource_type' ) );
if( is_wp_error( $term_link ) )
continue;
echo '<a>slug . '" href="' . $term_link . '">' . $term->name . '</a>';
// Add comma (except after the last theme)
echo ($i < count($terms))? ", " : "";
// Increment counter
$i++;
}
?>
</div>
<div class="clr"></div>
<a>"><?php
if ( has_post_thumbnail() ) {
echo '<div class="resource-photo">';
the_post_thumbnail("small");
echo '</div>';
}
?></a>
<div class="resource-content">
<ul class="meta clr meta-with-title">
<li><?php echo get_the_date(); ?></li>
<!--<li><?php /*$terms = get_the_terms( $post->ID , ( 'resource_author' ) );
// init counter
$i = 1;
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, ( 'resource_author' ) );
if( is_wp_error( $term_link ) )
continue;
echo '<a href="' . $term_link . '">'. '<span class="fa fa-user" aria-hidden="true"></span>' .' ' . $term->name . '</a>';
// Add comma (except after the last theme)
echo ($i < count($terms))? ", " : "";
// Increment counter
$i++;
}*/
?></li>-->
<li><span class="fa fa-folder-o" aria-hidden="true"></span> <?php $terms = get_the_terms( $post->ID , ( 'categories' ) );
// init counter
$i = 1;
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, ( 'categories' ) );
if( is_wp_error( $term_link ) )
continue;
echo '<a href="' . $term_link . '">' . $term->name . '</a>';
// Add comma (except after the last theme)
echo ($i < count($terms))? ", " : "";
// Increment counter
$i++;
}
?></li>
</ul>
<h3><a>"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<div class="filtered-results-meta">
<p><strong>Roles:</strong> <?php $terms = get_the_terms( $post->ID , ( 'role' ) );
// init counter
$i = 1;
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, ( 'role' ) );
if( is_wp_error( $term_link ) )
continue;
echo '<a href="' . $term_link . '">' . $term->name . '</a>';
// Add comma (except after the last theme)
echo ($i < count($terms))? ", " : "";
// Increment counter
$i++;
}
?></p>
</div>
</div>
</div>
<!-- MMC - End code -->
<hr />
</div>
<?php
}
?>
</div>
<?php
}
else
{
echo "No Results Found";
}
?>
AnonymousInactive
it not avada theme code its wp theme code. i dont use masonry.
here is the 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() )
{
?>
<?php echo $query->found_posts; ?> Ergebnisse 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( ‘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>
<h2>“><?php the_title(); ?></h2>
<?php if( have_rows(‘bilder’) ): ?>
<div class=”acf-gallery col-sm-12 col-xs-12 col-md-3″>
<div class=”fusion-gallery fusion-gallery-container fusion-grid-1 fusion-columns-total-10 fusion-gallery-layout-grid” style=”margin: -5px; position: relative; height: 1889.1px;”>
<?php $tmp=0;
while( have_rows(‘bilder’) ): the_row();
$image = get_sub_field(‘url’);
if ($tmp==0) : ?>
<div style=”padding: 5px; display: block; position: absolute; left: 0px; top: 0px;” class=”fusion-grid-column fusion-gallery-column fusion-gallery-column-1 hover-type-zoomin”><div class=”fusion-gallery-image”>” class=”fusion-lightbox” data-rel=”iLightbox[d2dfb9cbd4d28f5c119]” data-caption=””>
” alt=”” title=”” aria-label=”” class=”img-responsive wp-image-397″></div></div>
<div class=”clearfix”></div>
<?php $tmp++; ?>
<?php endif; ?>
<?php endwhile; ?>
</div>
</div>
<?php endif; ?>
<div class=”col-sm-12 col-xs-12 col-md-9″><?php the_content(); ?></div>
<p><?php the_category(); ?></p>
<p><?php the_tags(); ?></p>
<div class=”clearfix”></div>
</div>
<div class=”clearfix”></div>
<hr />
<?php
}
?>
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( ‘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”;
}
?>
AnonymousInactive
Here’s the current code for all-tips page.
I didn’t need to use the linked article you gave me, the issue was I had it in the wrong place + message was not showing if the classes were in the settings.
<?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='search-filter-results-list'>
<?php
while ($query->have_posts())
{
$query->the_post();
if (!rcp_user_can_access( get_current_user_id(), get_the_ID())) {
break;
}
?>
<a name="tip<?php the_ID() ?>"></a>
<div class='search-filter-result-item'>
<div class="reportEntryMeta">
<p><span class="date"><?php the_time('F j'); ?></span></p>
</div>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><br /><?php the_content( ); ?></p>
<?php if( have_rows('read_more') ): ?>
</br></br><strong>Read More</strong></br>
<ul class="links">
<?php while( have_rows('read_more') ): the_row();
// vars
$linktitle = get_sub_field('link_title');
$linkname = get_sub_field('link_name');
$link = get_sub_field('link');
?>
<li class="link">
<strong><?php echo $linktitle ?> </strong><a href="<?php echo $link ?>"><?php echo $linkname ?></a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?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>
<hr />
</div>
<?php
}
?>
</div>
<?php
}
else
{
if (!rcp_is_active()) { ?>
<h2 style="text-align: center;">Want more Tip Sheets?</h2>
<p style="text-align: center;">Sign up for Trivium Premium and get access to the full Tip Sheet Archive</p>
<p style="text-align: center;"><strong><a href="http://wordpress-126708-362887.cloudwaysapps.com/get-access/" target="_blank" rel="noopener">Sign Up</a></strong></p>
<p style="text-align: center;">Already have an account? <a href="http://wordpress-126708-362887.cloudwaysapps.com/login" target="_blank" rel="noopener">Log In</a>.</p>
<?php
}
?>
<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
<span>End of Results</span>
</div>
<?php
}
?>
Have a look at 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
*
*/
if ( $query->have_posts() ) {
?>
Found <?php echo $query->found_posts; ?> Results<br />
<div class='search-filter-results-list'>
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<div class='search-filter-result-item'>
<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>
<hr />
</div>
<?php
}
?>
</div>
<?php
} else {
//figure out which type of "no results" message to show
$message = "noresults";
if(isset($query->query['paged'])) {
if($query->query['paged']>1){
$message = "endofresults";
}
}
if($message=="noresults") {
?>
<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
<span>No Results Found</span>
</div>
<?php
} else {
?>
<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
<span>End of Results</span>
</div>
<?php
}
}
?>
AnonymousInactive
OK, first is solved, thanks a lot!
<?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
$nPosts = 0;
while ($query->have_posts())
{
$query->the_post();
$nPosts=$nPosts+1;
$big= ($nPosts % 3);
$isNextBig=($nPosts+1)%3;
if($big=="0") echo"<br /> <div class='et_pb_column et-last-child'>";
else if($isNextBig=="0")echo"<div class='et_pb_column et_pb_column_1_2 et-last-child'>";
else echo"<div class='et_pb_column et_pb_column_1_2'>";
?>
<?php
if ( has_post_thumbnail() ) {
?>
<a>">
<div class="cont">
<div class='postimage' style='background-image: url("<?php the_post_thumbnail_url("large");?>")'></div>
<div class="overlay_post">
</div>
</div></a>
<?php
}
?>
<div class="below_image">
<h2><a>"><?php the_title(); ?></a></h2>
<?php echo do_shortcode("[yasr_visitor_votes_readonly]"); ?>
<div class="desc"><?php the_excerpt(); ?></p></div>
<p class="meta"><?php the_date();echo" | by ";?>
<a>');" href="javascript:void(0);"><?php the_author();?></a></p>
<p class="meta"><?php $categories = get_the_category();
foreach($categories as $cat){
?>
<a>slug;?>');" href="javascript:void(0);"><?php echo $cat->cat_name;?></a>
<?php
}?>
<?php $terms = get_the_terms($post->ID, "sport"); $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) {?>
<a>slug;?>');" href="javascript:void(0);"><?php echo $term->name;?></a>
<?php
} } ?></p>
<br/>
<p><a>">READ MORE</a></p>
</div>
</div>
<?php
}
}
else
{
echo "Ops! no results found!";
}
?>
<script type="text/javascript">
function searchCat(slug){
jQuery('select[name="_sft_category[]"]').val(slug).change();
}
function searchAuthor(slug){
jQuery('select[name="_sf_author[]"]').val(slug).change();
}
function searchSport(slug){
jQuery('select[name="_sft_sport[]"]').val(slug).change();
}
</script>
Hi
I am sorry that I have not been able to take a look at this thread this afternoon, because we had a power outage this afternoon.
Reading your last post, I took a quick look at the page source code and I can see the other form.
But, on the page that works, that also has two forms, so I am not certain this is the issue.
I think it may be the structure of the page, but why should work and the other not, I am not sure.
Our default infinite scroll template has the post container set to .search-filter-results-list and the individual post container set to .search-filter-result-item
If I look at your code (for the broken page), it does not have an Ajax Container and has .worterbuch as the Post Container.
Maybe it should look more like 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
*
*/
if ( $query->have_posts() )
{
?>
<div class='search-filter-results-list'>
<?php
while ($query->have_posts())
{
$query->the_post();
?>
<table class="worterbuch search-filter-result-item">
<tbody>
<tr>
<td colspan="2" class="ueberschrift"><?php the_title(); ?></td>
</tr>
<tr>
<td width="5%" class="sprache">HE</td>
<td width="95%" class="inhalt-he"><?php the_content(); ?> </td>
</tr>
<tr>
<td width="5%" class="sprache">EN</td>
<td width="95%" class="inhalt"><?php the_excerpt(); ?></td>
</tr>
</tbody>
</table>
<?php
}
?>
</div>
<?php
}
else
{
echo "Keine weiteren Suchergebnisse";
}
?>
AnonymousInactive
… here we have a different page where the infinite scroll works perfect:
<?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
while ($query->have_posts())
{
$query->the_post();
?>
<table class=”worterbuch-he”>
<tbody>
<tr>
<td colspan=”2″ class=”ueberschrift”><?php the_title(); ?></td>
</tr>
<tr>
<td width=”5%” class=”sprache”>EN</td>
<td width=”95%” class=”inhalt-ivr”><?php the_content(); ?> </td>
</tr>
<tr>
<td width=”5%” class=”sprache”>DE</td>
<td width=”95%” class=”inhalt-ivr”><?php the_excerpt(); ?></td>
</tr>
</tbody>
</table>
<?php
}
?>
<?php
}
else
{
echo “אין תוצאות נוספות”;
}
?>