Posted By

FatFolderDesigner on 04/05/12


redirect plugin wordpress

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Wordpress Redirects with wp_redirect()

 / Published in: PHP


This needs to be run on an action, or at least I wanted able to get it to run outside of an action, I suggest template_redirect. More information at the link.

  1. // The Base Function
  2. wp_redirect('',301);
  4. // In Use Example
  5. add_action('template_redirect', 'redirect');
  6. function redirect(){
  7. if($redirect){
  8. wp_redirect(get_bloginfo('url').'/wp-content/plugins/redirector/site/index.php',302);
  9. }
  10. }

Report this snippet  

You need to login to post a comment.