redirect pages with no content, instead of 404 error, using max_num_posts?
If the rest of your function works you just need to add a call to wp_safe_redirect and hook the whole thing into WordPress. I think that the first hook that will have a populated $wp_query is wp. So alter the last part of your function… if($max_page < $paged){ wp_safe_redirect(get_bloginof(‘url’),’301′); } And then add the following … Read more