Custom ‘No Results’ Page Not Working
-
Hi guys,
About a year ago I asked if it were possible to add a code snippet that would redirect users from the ‘no search results found’ page, to a custom page that showed videos of cats.
Just thought I’d retry it out last night, and it’s no longer working.
The code snippet supplied was:
/*Relevanssi Snippet */ add_filter( 'relevanssi_modify_wp_query', 'rlv_empty_redirect' ); function rlv_empty_redirect( $query ) { if ( empty( $query->query_vars['s'] ) ) { wp_safe_redirect( '/no-results/' ); exit(); } return $query; }
…and I wondered if over the last year with all the WordPress updates, it no longer worked?
Thanks for any help!
- The topic ‘Custom ‘No Results’ Page Not Working’ is closed to new replies.