Pro 4.x Feature Request: 'Have Posts' Condition

Hi there,

I have been building a Search Results Layout and came across the need for a Have Posts and Have No Posts Condition to be able to show a different message (no results found) and the latest posts if no search results are found.

I was able to filter into the $condition_contexts section to add a ‘Have Posts’ / ‘Have No Posts’ selection, and adding a simple condition_rule_ function to handle the condition by returning the WP default have_posts(). This works in my scenario, but it strikes me that a similar Conditional option for all Looper capabilities (‘Have Items’ within the Looper Provider, which works for the Looper_Provider_Array return as well as the Looper_Provider_Wp_Query) would be very useful in many cases. I haven’t looked in to expanding my filter to work for all these, so it would be great if you’re able to extend this option, or a similar solution, to work for all types of loopers / queries / loops!

Cheers!

Hey @arthurodb,

Thanks for the feedback. We really appreciate it. We’ve added this as a feature request so it can be taken into consideration for future development.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

Hi @arthurodb,

Hope you’re doing well. I wanted to followup here to let you know we’ve added this for Pro 4.1 which is coming in the next few weeks. And nice job getting one working yourself with custom code! We did end up getting it to work generically on all looper types.

1 Like