[wp-hackers] Styling of "post date"

Allan Mertner amwp at mertner.com
Sat Sep 11 23:36:51 UTC 2004


Mike Little wrote:

>>I took it further and just made it a div.
>>
>><?php the_date('', '<div class="postdate">','</div>'); ?>
>>    
>>
>
>But then you lose the *semantic* meaning of that part of the markup
>(the fact that it is a second level heading). That would be a bad
>thing.
>
>The correct way to style the date does not involve any changes to your template!
>  
>
It does, if you have more than one h2 tag inside the content - say, 
inside a blog post.  Adding a class specifier to allow the css to target 
this element specifically would make sense: it adds readability to the 
stylesheet and allows you to target your style to *that* element only.

Allan




More information about the hackers mailing list