Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* this is the very beginning of the index.php */
- /*
- * redirect when search & find is empty:
- * problem: under circumstances (querying by many parameters) there is an empty result and instead of the archive.php the index.php opens
- * hacky solution: check for the parameter 'post_types' in the url on index.php and if found, redirect to the specific archive page
- * note: change the post_types var's to yours, change the url slug fitting your slugs
- */
- if(isset($_GET['post_types'])) {
- $var = $_GET['post_types'];
- if($var == 'publication'){
- wp_safe_redirect( ''.get_home_url().'/publication' ); exit;
- }else if ($var == 'project'){
- wp_safe_redirect( ''.get_home_url().'/projects' ); exit;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement