Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

magician11 on "delayed redirect"

$
0
0

I want to display a page for a few seconds and then redirect to the homepage.

Something like..

status_header(200);
get_header();
echo('<h2>content</h2>');
get_footer();
sleep(5);
wp_safe_redirect(get_site_url());

This doesn't work because I'll get

Warning: Cannot modify header information - headers already sent by

possible solutions
Sounds like I could try and add

<meta http-equiv="refresh" content="10;url=http://www.example.php">

Apparently this is now considered bad practice?

Or do something like

ob_flush();
flush();
sleep(5);

Help? Suggestions?

Thanks.


Viewing all articles
Browse latest Browse all 8245

Trending Articles