No items message for empty filters
-
Hi,
I have the pro version of the plugin.
I am using the paged isotope layout. I have all my filters above working great, but due to the fact that there aren’t any posts / items on one of the filters on the first page nothing shows up.
I am wondering, can you add in an error message if there are no posts/items within a particular filter on that page?
Many Thanks
-
Hi there,
At the moment that’s not possible but I’ll look into it.
Brecht
Ok.
That would be great if you can look into that for me. 🙂
Thanks.
Is it something I could do?
I am using your plugin as part of a site build at the moment.
Is it urgent? I can add this feature in the next update (in about 2 weeks, if I had to guess).
It is pretty urgent…
The site is due to go to the client later today/tomorrow but due to go live next week I believe.
Hi again,
I’ve looked into it for you and for now you could do this yourself by adding the following JavaScript to any JS file that’s loaded on that page:
jQuery(document).on('wpupgFiltered', function() { var container = jQuery('#wpupg-grid-my-blog-posts'), nbr_filtered = container.data('isotope').filteredItems.length; jQuery('.wpupg-empty').remove(); if(nbr_filtered == 0) { container.after('<p class="wpupg-empty">No posts found on this page.</p>'); } });You’ll have to replace “my-blog-posts” in “wpupg-grid-my-blog-posts” with the actual ID of your grid.
Let me know if this works for you!
Brecht
Beautiful!
Thats magic. Thanks! A little bit of styling and that will work great thank you.
To be a little cheeky… Any ideas on the previous page/next page buttons..? 😛
Cheers
Good to hear that’s working!
I’m afraid the pagination thing is to require a bit more code. Will look into it for the next update though.Hi again,
I wanted to let you know that we’ve just released WP Ultimate Post Grid 2.1 which includes the possibility to show a message when there are no items to display because of the filtering.
Kind regards,
Brecht
The topic ‘No items message for empty filters’ is closed to new replies.