Imagine the following situation:
//header.php contains:
<header id="header">logo and navigation</header>
//my-template.php contains:
<?php get_header(); ?>
<style type="text/css">#header { display: none; }</style>
<div class="main-container-of-my-template"></div>
<?php get_footer(); ?>
This will disable <header> for my-template.php in the most modern browsers (except IE9) but it's not valid solution. Is there a way to use something like wp_enqueue_style(); directly in my-template.php to make it load that style in <head> in header.php? Just to make it valid.
I want to keep this modular, so I don't want to put if statement like this in header.php (it will not be stand-alone modular page template anymore):
<?php if(is_page_template( 'my-template.php' )){ ?>
<style type="text/css">#header { display: none; }</style>
<?php } ?>
<style>in header.php but I still want to have it in my-template.php and not move it entirely to header.php. It doesn't matter why I want to hide header. I just wanted to show idea where something can't be achieved using simple style.css. – Paul Jul 29 '12 at 11:55<style>in<head>section but doesn't want to keep the code inheader.php, Right ? – amit Jul 29 '12 at 14:43