Forums › Forums › Search & Filter Pro › Load More ajax functionality stopped working after updating plugin.
- This topic has 17 replies, 3 voices, and was last updated 4 years ago by Ross.
-
Anonymous(Private) December 4, 2020 at 5:26 pm #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(Private) December 7, 2020 at 7:49 pm #269033Hi Tricia
Actually, for things like that, I like to create shorcodes, it can be quite simple:
https://wordpress.stackexchange.com/a/213706/37783So using that, and combining it with a WP_Query:
https://searchandfilter.com/documentation/search-results/custom/#wp-queryYou 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
Ross Moderator(Private) December 8, 2020 at 8:21 am #269059No 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(Private) December 9, 2020 at 4:33 pm #269309I 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(Private) December 14, 2020 at 11:25 am #269705This reply has been marked as private. -
AuthorPosts