We're merging with GenerateBlocks! Learn more here.

[Resolved] Disable ‘ Sorry, no posts found’ message

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Disable ‘ Sorry, no posts found’ message

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #26917
    Christopher
    Participant

    Hi there,

    How can I disable the ‘Sorry, no posts found’ message, so that if there are no posts assigned to the category that ShowPosts is set to display it doesn’t return anything?

    My use case is this:
    For a client I have a shortcode block setup with showposts set to display the latest post assigned to the ‘announcement’ category. The block is positioned on the homepage where an announcement can be made, when my client wants to. Most of the time, this block will be empty. The idea being, if they want to make an announcement they simply write a post and assign it to the announcement category, and clear the category if they want to remove it.

    The problem with this is that when no posts are assinged, showposts returns the ‘Sorry, not posts found’ message

    Any ideas?

    #26954
    Christopher
    Participant

    I’ve done some more experimenting around this, and have found a workaround, but I also think I may have stumbled upon a bug.

    First of all the workaround:
    In ‘More Settings’ within the individual list, find ‘No results message’. If this is empty then ‘Sorry, no posts found’ is displayed on the live page.
    To get rid of the message simply put a space in the field and save.

    This is a little problematic as it’s not easy to see the different with the eye, but it works. It might be worth considering pre-populating the field with ‘Sorry, no posts found’ and then have it not return any output if the field is empty.

    Now on to a possible bug:

    When implementing the above a list was built set to display posts from the category ‘ announcement ‘, to create the list I had to assign this category to a post, I couldn’t assign an existing category to a list if there wasn’t any posts assigned to it. So figuring that out all looks good.

    My list is created, I add the space to the ‘ No results message ‘ to get it to return no output if no posts have the announcement category assigned to it, then to test this is working as intended I remove the announcement category from the one post which has it. I load the page – bingo, no message or output from showposts. I re add the announcement category to the post, and reload the live page, and the post appears in the right place. I then remove the category from the post again as I expect my client to do when there is no need for an announcement. Note – category still exists. I go into ShowPosts and make an unrelated change – anything color or anyother setting (not anything to do with category selection) , and save. It then saves without any category applied. So if a post has the announcment category reapplied, it no longer appears on the site.

    Saving a list set to show posts from a category, which still exists, but no longer has any posts assigned to it – removes that category from the list, so its function no longer works even when a post has the category applied to it in the future.

    #26965
    elvin
    Moderator

    Hi there,

    This is a replicable bug on the official release that is addressed on the Alpha version.
    https://wpshowposts.com/wp-show-posts-1-2-0/

    Tweak: Show empty categories in taxonomy list

    Is included on the changelogs.

    You can try the latest alpha version out and test it if you’d like. 😀

    As for when the official 1.2.0 release date, Tom has yet to announce a schedule for it but we will make sure to give a heads up when it’s ready. 😀

    #27036
    Christopher
    Participant

    Thank you, the 1.2.0 alpha does indeed fix the empty category issues and looks good.

    I wouldn’t normally consider using an alpha on a live site, but it seems to work well. Is it stable enough to use on a live site? Are there any problems reported?

    #27108
    elvin
    Moderator

    We’ve yet to find ones aside from the known bugs from previous versions like having multiple WPSP list in one page with pagination, masonry and/or carousel enabled.

    But we really can’t recommend using it as there’s no telling what could go wrong considering each site’s unique mix of plugins.

    And my apologies for being unable to give out a set date for the official release. Tom’s pretty busy with the next big release for GeneratePress (3.1.0) and premium.

    It’s target release date is Early/Mid March and if all goes as planned, Tom should be able to give out the date for WPSP as well after that.

    #27141
    Christopher
    Participant

    Thank you for the reply. So much excitement for your range of products, can’t wait!

    #27197
    elvin
    Moderator

    No problem. We’ll make sure to keep you posted. Please look forward to it. 😀

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.