WordPress.org

Ready to get started?Download WordPress

Forums

Setting custom meta only on one page? (3 posts)

  1. ZackVee
    Member
    Posted 1 year ago #

    Alright so I want one certain page on a website to emulate under the style of IE7 but the rest of the site to emulate IE8. How do I do this through the meta tags? I was trying the following with no results:

    if(is_page('IE7 page')){
     <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7,chrome=1">;
     }
    else{
     <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8,chrome=1">;
     }

    What exactly am I doing wrong and how do I implement this correctly? Any help will be greatly appreciated! :)

  2. vahidd
    Member
    Posted 1 year ago #

    Hello,
    Try this:

    if(preg_match('/MSIE 7.0/i',$_SERVER['HTTP_USER_AGENT']))
    {
    	// Codes for just ie7
    } else {
    	// other versions of ie and other browsers
    }
  3. ZackVee
    Member
    Posted 1 year ago #

    <head>
    if(preg_match('/MSIE 7.0/i',$_SERVER['HTTP_USER_AGENT']))
    {
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7,chrome=1"> // Codes for just ie7
    } else {
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8,chrome=1">        // other versions of ie and other browsers
    }

    Didn't seem to work, it just added the above text to the header bar. I realize I forgot to mention this is in the head content.

Topic Closed

This topic has been closed to new replies.

About this Topic