• Hi all,

    I have a question about timed redirects.

    we have setup a site using the free Woothemes placeholder theme, it is very limited but that is OK – the site is simple.

    After 20 seconds I would like the page to redirect to another URL – would it be possible to insert some code into footer.php to do this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter thewaves

    (@thewaves)

    I have found what looks like the right code:

    // Redriect with a delay:
    header(‘Refresh: 20; url=http://www.example.org/’);

    Can this be inserted antwhere in footer.php?

    Any input is welcome.

    Here you can read a lot about redirection issues:
    http://en.wikipedia.org/wiki/URL_redirection

    Be aware that if you do a lot of redirection, google may penalize you.
    If your site has moved, you should redirect with 301 permanently moved.

    If redirecting after showing content, I would hook on the get_header .

    function redirectMe(  )
    {
    
    }
    add_action('get_header', 'redirectMe');

    You would need to inject the <meta refresh… /> within the <head></head>. If you wish different redirects, you can inside that function parse out your custom fields, inside the meta refresh.

    Thread Starter thewaves

    (@thewaves)

    OK – I think you have sailed past my level of expertise – which PHP file do I put this code in? Footer.php?

    Thread Starter thewaves

    (@thewaves)

    I have tried putting the following in the header & footer

    <?php
    // Redriect with a delay:
    header(‘Refresh: 20; url=urel’);
    ?>

    It throws the same error every time.

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/07/8625307/html/wp-content/themes/placeholder/header.php:5) in /home/content/07/8625307/html/wp-content/themes/placeholder/header.php on line 29

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Timed Redirect’ is closed to new replies.