Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

While my related question on Stack Overflow should explain the basic CSS for this once it gets answered, how would I define a custom font family for a wordpress blog that will only apply to a <span> and will not affect the site-wide font families being used by the theme on my wordpress site?

Related: Creating Useable Custom Font Family

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can use this function: http://codex.wordpress.org/Function_Reference/body_class

Use this in your header.php

<body <?php body_class(); ?>>

This gives each page a different class and so you can use CSS to set the font-family for a specific page like so:

body.blog span.yourClassName{ font-family:; }

Then of course the is also the jQuery solution using the .children() function

share|improve this answer
    
Are you saying you want to apply classes to all elements within a specified element, or? –  marcup Aug 22 '12 at 19:31
    
If you look at the code above closely you will see that the CSS rule selects all span's with a class of .yourClassName within the blog page only. –  marcup Aug 22 '12 at 19:35
    
marcup, i had old information, you appeared to have edited, so that answers my question. Thanks! :) –  Thomas W. Aug 22 '12 at 19:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.