Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //MAKE SURE TO REMOVE THIS WHOLE LINE FIRST
- add_filter( 'gravityview/template/text/no_entries', 'modify_gravityview_no_entries_text', 10, 3 );
- function modify_gravityview_no_entries_text( $existing_text, $is_search = false, $context = null ) {
- $view_id = $context->view->ID;
- if($view_id == 8) //Change this number to your View ID
- {
- if( $is_search ) {
- $return = 'Your search came up empty! [Use your own new search text]';
- } else {
- $return = "There just aren't any results! [Use your own text]";
- }
- }
- //You can repeat this section for another View
- elseif($view_id == 9) //Change this number to your View ID
- {
- if( $is_search ) {
- $return = 'Your search came up empty! [Use your own new search text]';
- } else {
- $return = "There just aren't any results! [Use your own text]";
- }
- }
- // End of repeatable block
- //If you have more than 2 View where you want to use the code, Please copy and paste the repeatable block before this comment, and remember to update the View ID
- else{
- return;
- }
- return $return;
- }
Add Comment
Please, Sign In to add comment