Guest User

Untitled

a guest
Feb 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <?php //MAKE SURE TO REMOVE THIS WHOLE LINE FIRST
  2. add_filter( 'gravityview/template/text/no_entries', 'modify_gravityview_no_entries_text', 10, 3 );
  3. function modify_gravityview_no_entries_text( $existing_text, $is_search = false, $context = null ) {
  4. $view_id = $context->view->ID;
  5. if($view_id == 8) //Change this number to your View ID
  6. {
  7. if( $is_search ) {
  8. $return = 'Your search came up empty! [Use your own new search text]';
  9. } else {
  10. $return = "There just aren't any results! [Use your own text]";
  11. }
  12. }
  13. //You can repeat this section for another View
  14. elseif($view_id == 9) //Change this number to your View ID
  15. {
  16. if( $is_search ) {
  17. $return = 'Your search came up empty! [Use your own new search text]';
  18. } else {
  19. $return = "There just aren't any results! [Use your own text]";
  20. }
  21. }
  22. // End of repeatable block
  23.  
  24.  
  25. //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
  26.  
  27. else{
  28. return;
  29. }
  30. return $return;
  31. }
Add Comment
Please, Sign In to add comment