Add header meta code

hi!

i wanna redirect from the start site where is a small video after 10 seconds to another site.
it is just for the start site.
for that i need to add some code to insert in the header meta.

is there a way to do this without a plugin? that would be awesome!

i think this code should work?:

<meta http-equiv=”Refresh” content=”10;url=http://www.xxx.com/home2“>

thanks in advance for your help.

cheers

Hello Harald,

Thanks for your details.

The easiest way you can do this is to install “Insert Headers and Footers” plugin. You can check it out here: https://wordpress.org/plugins/insert-headers-and-footers/

Once installed and activated, please go to Settings > Insert Headers and Footers > Header and this is where you will insert your code:

<meta http-equiv="Refresh" content="10;url=http://www.xxx.com/home2">

Please let us know if this works out for you.

hi,

that works, but now it does it on all sites. this should only be on one site at start (start page)… the code should be “injected” on start page after 10 seconds it should move you to home.

any advice?

thanks

Hi Harald,

In that case, instead of implementing it like that way, please add this code to your child theme’s functions.php

add_action('wp_head', 'redirect_after_ten', -999999999);

function redirect_after_ten () { 

if ( is_front_page() ) echo '<meta http-equiv="Refresh" content="10;url=http://www.xxx.com/home2">';

}

Please check this about the child theme installation https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57

Hope this helps.

hi rad,

thanks that worked perfect! :slight_smile:

cheers

Glad it works and you’re most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.