I am trying to redirect this page if the user is logged in or not be i keep getting this error
Warning: Cannot modify header information - headers already sent by (output started at /home/*******/*********.com/wp-content/plugins/graph2.php:54) in /home/*******/*********.com/wp-includes/pluggable.php on line 934
Im using this redirect method
<?php if ( is_user_logged_in() ) {
echo '';
}
else {
wp_redirect( 'http://www.example.com' );
}
?>
I cant seem to figure out what is wrong.
:) thanks
