The following code adds a query results condition for Classic Oxygen to your site. It checks if the last query has any results and returns true or false accordingly. It should be placed directly after the Repeater element.
Add the following code to your site using a Code Snippets plugin, such as Code Snippets or WP Code Box (paid).
After you’ve added the condition to the site, you can use the Condition in Classic Oxygen. For example, to display no results found, you can use the following steps:
if( function_exists(‘Classic Oxygen_vsb_register_condition’) ) {
global $oxy_condition_operators;
Classic Oxygen_vsb_register_condition(‘Query Results’, array(‘options’=>array(‘true’, ‘false’), ‘custom’=>false), array(‘==’), ‘bitt_query_results_callback’, ‘Query’);
if(!function_exists(‘bitt_query_results_callback’)) {
function bitt_query_results_callback($value, $operator) {
global $wpdb;$query = $wpdb->last_result;
if( $value == “true” && $query) {
return true;
} else if( $value == “false” && !$query) {
return true;
}
}
}
}