Forums › Forums › Search & Filter Pro › no opacity change while loading results on custom display results
- This topic has 15 replies, 3 voices, and was last updated 4 years ago by Trevor.
-
Anonymous(Private) November 18, 2020 at 7:11 pm #267016
Hi there,
I am using a custom query for displaying the results. Search and results are on the same page.
When a user clicks a checkbox, nothing happens while the results are loading. If I use a shortcode or the Divi Plugin, the contents opacity changes to 0.5 while loading the results.
I need some sign, that the results are loading. Alternativly I tried to show a loading animation.
I tried this solution:$(".searchandfilter").on("sf:ajaxstart",function(){ //show loader console.log("ajax start"); }); $(".searchandfilter").on("sf:ajaxfinish",function(){ //hide loader console.log("ajax complete"); });
but there is no logging in the console.
I don’t know what goes wrong and need some help.
Kind regards
SandraAnonymous(Private) November 19, 2020 at 11:07 am #267068Hi Trevor,
thanks for your reply.
You can see filter and results on this page: https://gesunder-wmk.de/zzzzzzzzztest-mehr-wissen/This code:
———————————
<?php
$args = array(
‘posts_per_page’ => 100,
‘order’ => ‘DESC’,
‘orderby’ => ‘title’,
‘post_type’ => ‘mehr-wissen’,
);
$args[‘search_filter_id’] = 5565;
// the query
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
// the loop
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<div class=”mw-wrapper”>
<div class=”mw-header”>
<figure><?php the_post_thumbnail(); ?></figure>
<div class=”headlines”>
<h2><?php the_title(); ?></h2>
<?php if(get_field(‘headline_2’)) { echo ‘<h3>’ . get_field(‘headline_2’) . ‘</h3>’; } ?>
<?php if(get_field(‘subline_zu_headline_2’)) { echo ‘<p>’ . get_field(‘subline_zu_headline_2’) . ‘</p>’; } ?>
</div>
</div><div class=”mw-content”>
<?php the_content(); ?>
</div>
</div><?php
endwhile;
// end of the loop
wp_reset_postdata();
else :?>
<p><?php _e( ‘Sorry, no posts matched your criteria.’ ); ?></p>
<?php endif;
?>
——————————–
I added the code by creating a divi module with the plugin Divi Module Builder by Divi Plugins.Greetings
SandraAnonymous(Private) November 20, 2020 at 9:30 am #267221Hi all, So what was the outcome?
using this:
$(“.searchandfilter”).on(“sf:ajaxstart”,function(){
//show loader
console.log(“ajax start”);
});$(“.searchandfilter”).on(“sf:ajaxfinish”,function(){
//hide loader
console.log(“ajax complete”);
});I see ajax is working but no console logs….
-
AuthorPosts