1 2 3 4 5 6 7 8 9 10 11 12 13 | /** * @source: https://github.com/elementor/elementor/issues/7624#issuecomment-645129375 */ add_action('elementor/query/query_results', function($query) { $total = $query->found_posts; if ($total == 0) { if ( $query->get("post_type") == "chapter" ) { echo '<h4>Sorry! no chapters found.</h4>'; } } }); |