Forums Forums Search & Filter Pro Results are not loading

Viewing 10 posts - 1 through 10 (of 12 total)
  • Anonymous
    #39455

    Hello,

    I’ve used your’re plugin before and it worked great, thank you for that. However on another project I’m working now i’ve run into a problem. When clicking on a filter the page fades out but the results are not filtered. In the console I get the following error:

    
    jquery.min.js:4 GET http://wederopbouwvansalland.nl/boerderijen/lijst/_sft_gemeente=hellendoorn 404 (Not Found)
    

    Settings for displaying results
    Setting loading results

    The website page:
    http://wederopbouwvansalland.nl/boerderijen/lijst/

    Thnx in advance!

    Ross Moderator
    #39509

    Hey Kris

    Do you not see an error message at the top of that page?

    There should be one showing, saying that you do not have a valid Results URL – this is causing malformed URLs which gives you a 404.

    Thanks

    Anonymous
    #39513

    Hey Ross,

    No I dont see a error at the top of the page.

    Anonymous
    #39514

    Any idea what I am doing wrong? and how I can solve it?

    Anonymous
    #39543

    I’ve still no idea how to solve this?? please help.

    Ross Moderator
    #39546

    I can see in that screenshot, you have not filled in your Results URL.

    If you are not getting an error message, you may be using an old version of S&F.

    Info on the results URL – https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/

    Thanks

    Anonymous
    #39553

    The error message is gone now. I’m trying to load the result on a custom page template. Using the ‘Display results method: custom’ option. Is that possible? Cause the results still don’t come up.

    Ross Moderator
    #39606

    Hey Kris

    Do you want to use S&F with some custom loop on that page?

    This is fairly undocumented (its a new, pretty silently added option in the last update) – but I can show you how to hook that up if necessary.

    Otherwise, I would say to use the shortcode method, and customise the output of results following the instructions here:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    Thanks

    Anonymous
    #39621

    I would like to see the custom option. Here’s the current code with custom post loop:

    
    <div id="filters">
    
    	<h6>Filters</h6>
    	
    	<?php echo do_shortcode( '[searchandfilter id="116"]' ); ?>
    
    </div>
    
    <div id="page-content">
    
    	<div id="main">
    
    	<?php 
    
    		$args = array(
    			'post_type'		=> 'boerderij',
    			'posts_per_page'	=> 0,
    			'suppress_filters'      => true,
    		 	'post_status'		=> 'publish'
    		);
    
    		query_posts( $args );
    
    		while ( have_posts() ) : the_post(); 
    
    			$image_id = 77;
    
    			$image = wp_get_attachment_image_src( $image_id , 'thumbnail', false );
    		?>
    
    			<div class="boerderij inc-inhoud">
    				<a href="<?php the_permalink(); ?>">
    					<div class="image">
    						<img src="<?php echo $image[0]; ?>" alt="#">
    					</div>
    					<div class="text">
    						<h2><?php the_title(); ?></h2>
    						<ul>
    							<li>Lorem ipsum dolor.</li>
    							<li>A, eos, eligendi. Lorem ipsum dolor sit amet.</li>
    							<li class="inhoud"><span class="interview">Interview</span><span class="dossier">Hersteldossier</span></li>
    						</ul>
    					</div>
    				</a>
    			</div>
    
    	<?php 	
    		endwhile; 
    	?>
    
    	</div><!-- #main -->
    
    	<div class="pagination">
    		<?php next_posts_link( "Volgende" ); ?>
    		<?php previous_posts_link( "Vorige" ); ?>
    	</div>
    
    </div><!-- #page-content -->
    
    Ross Moderator
    #39633

    Hey Kris

    Instead of:

    $args = array(
    	'post_type'		=> 'boerderij',
    	'posts_per_page'	=> 0,
    	'suppress_filters'      => true,
    	'post_status'		=> 'publish'
    );
    
    query_posts( $args );

    You can simply use:

    do_action('search_filter_query_posts', 96);

    Ref – https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Query_Posts

    Alternatively, you could attach S&F to your existing query (of course update the S&F ID):

    $args = array(
    	'post_type'		=> 'boerderij',
    	'posts_per_page'	=> 0,
    	'suppress_filters'      => true,
    	'post_status'		=> 'publish',
    	'search_filter_id'	=> 123
    );
    
    query_posts( $args );

    However, S&F will replace nearly all parameters from the query with its own, so your post type will be overwritten, posts per page and post status etc…

    So it probably easier using the S&F action I mentioned above as the rest becomes fairly pointless. 😀

    Official write up on all of this coming in the next few weeks.

    Thanks

Viewing 10 posts - 1 through 10 (of 12 total)