Jump to content

Archived

This topic is now archived and is closed to further replies.

ketri

How to properly add IE-detection classes to child-themes header.php?

Recommended Posts

ketri

Hello! This is how my child-themes header.php starts:

 

<?php
/**
 * HEADER
 *
 * This file controls the HTML <head> and top graphical markup (including
 * Navigation) for each page in your theme. You can control what shows up where
 * using WordPress and PageLines PHP conditionals.
 *
 * @link        http://www.pagelines.com/
 *
 * @author      PageLines Inc.  http://www.pagelines.com/
 * @copyright   Copyright (c) 2008-2013, PageLines  [email protected]
 */


pagelines_register_hook('pagelines_before_html'); // Hook
?><!DOCTYPE html>
<html <?php language_attributes(); do_action('the_html_tag'); ?>>
<head>
This is what I've had in my previous themes:

 

<!doctype html>
<!--[if lt IE 7]>  <html class="ie ie6 lte9 lte8 lte7"> <![endif]-->
<!--[if IE 7]>     <html class="ie ie7 lte9 lte8 lte7"> <![endif]-->
<!--[if IE 8]>     <html class="ie ie8 lte9 lte8"> <![endif]-->
<!--[if IE 9]>     <html class="ie ie9 lte9"> <![endif]-->
<!--[if gt IE 9]>  <html> <![endif]-->
<!--[if !IE]><!--><html  xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns# fb:
http://www.facebook.com/2008/fbml"
<?php language_attributes(); ?> class="no-js"><!--<![endif]-->

What does the 

do_action('the_html_tag');

do? 

And how would my child-themes header.php would look like with those detection classes added?

Thank you very much.

 

Share this post


Link to post
Share on other sites
greenfly
Are you looking for the means to target your site content in ie as to apply custom style that shows only in IE?

The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
ketri

Are you looking for the means to target your site content in ie as to apply custom style that shows only in IE?

Yes. And also using them for if-else on javascript.

 

 

EDIT: ok I see that the pro tools plugin adds this functionality. Thanks!

Share this post


Link to post
Share on other sites
James B

Hi there, yes Pro Tools adds the browser classes :-)

 

A full list of the classes can be found at http://support.pagelines.me/docs/plugins/browser-specific-css/


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

×