Geogol

HomeQuotesSpecsQ&ABlog
HomeBlog

How to redirect Javascript disabled WordPress blog page to Noscript page PHP code

Learn how to redirect javascript disabled wordpress blog page to Noscript page to show request message to users.

Some people disable javascript on their browsers. So, your website may not work properly on their browsers who disabled Javascript.
You can redirect javascript disabled pages to noscript page or mobile page.
Then you can request users to enable javascript on their browsers.
Here is the wordpress code to redirect pages to noscript page.

/** php code for header.php page **/
<?php if ( ! is_single() ){echo '<noscript><meta http-equiv="refresh" content="0; url=http://howtodoany.com/javascript-required/" /></noscript>
';}?>

<?php  if ( is_single() ) { $id = get_the_ID(); if ( $id!=10965 )
{echo '<noscript><meta http-equiv="refresh" content="0; url=http://howtodoany.com/javascript-required/" /></noscript>
';}}?>

<!-- HTML Code -->

<noscript>
<a href="http://howtodoany.com/javascript-required/">Click here to continue</a>
</noscript>

<!-- or -->

<noscript>
  <meta http-equiv="refresh" content="0;url=http://howtodoany.com/javascript-required/">
</noscript>
Share with your friends: Facebook Twitter Google+ Blogger Archive

Leave a Reply

Your email address will not be published.