Forums Forums Search & Filter Pro Load More ajax functionality stopped working after updating plugin.

Tagged: ,

Viewing 8 posts - 11 through 18 (of 18 total)
  • Anonymous
    #268861
    This reply has been marked as private.
    Ross Moderator
    #268863
    This reply has been marked as private.
    Anonymous
    #268867

    Well actually…. I added those settings back to custom fields and then set back to using the shortcode method. If I update the plugin, those field will no longer be used. And what you’re saying totally makes sense, so I understand why.

    I guess this means I need to completely switch to the custom method? I’ve used this method in the past, before embracing g-blocks. How do I do that without a custom page template, so that the client can add blocks above and / or below the filter and grid views?

    Ross Moderator
    #269033

    Hi Tricia

    Actually, for things like that, I like to create shorcodes, it can be quite simple:
    https://wordpress.stackexchange.com/a/213706/37783

    So using that, and combining it with a WP_Query:
    https://searchandfilter.com/documentation/search-results/custom/#wp-query

    You would get something like:

    function get_search_search_results($atts) {
    	ob_start();
    	$args = array(
    		'post_type'        => 'post',
    		'search_filter_id' => 123,
    	);
    	$query = new WP_Query($args);
    	// now you can loop through the results just like in results.php -
    	// and maybe load a template, or any other PHP file - eg - get_template_part( 'my-loop' );
    	// in between 'ob_start' and 'ob_get_clean' you can do stuff like "echo" as normal
    	return ob_get_clean();
    }
    add_shortcode( 'my-search-results', 'get_search_search_results');

    And you can use that loop / template anywhere via – [my-search-results]

    Let me know how you get on and if all is clear above!

    Best

    Anonymous
    #269044

    Thanks Ross. I’ve been stewing on this and my thinking was kinda moving that direction, but I hadn’t quite made it to a shortcode within a shortcode. I think this should work!

    Thanks again!

    Ross Moderator
    #269059

    No worries…

    To be honest I’m thinking we shouldn’t have changed this feature as we’ll be moving to v3 in not too long which has a lot of differences in terms of setup anyway.

    If you get stuck just give me a shout.

    Anonymous
    #269309

    I was able to go the custom route, apply fixes to the live site and update – so all good for now. But I did notice something that I wanted to share with you, as it may be relevant.

    I use your plugin a LOT – in most cases, we’ve used archive views and/or the custom method to implement. But I do have a few other sites that I used the shortcode method in. I’m noticing the ones that are querying custom post types and taxonomies need this fix. I have one that queries regular posts, and it did NOT break with the update. So this issue may be for CPTs and/or custom taxonomies only? Hope this helps.

    Thanks again for all your help in getting me lined out. 🙂

    Ross Moderator
    #269705
    This reply has been marked as private.
Viewing 8 posts - 11 through 18 (of 18 total)