I am trying to use different fonts and styles for each post title. How can I do this?
I am trying to use different fonts and styles for each post title. How can I do this?
post_class()
http://codex.wordpress.org/Function_Reference/post_class
or basic principle to give a post dependant css class to the post title;for example:
<h3 class="post-title post-title-<?php the_ID(); ?>"><?php the_title?(); ?></h3>
Specifically using alchymyth's example the css required to style an individual post title (style.css in your theme):
/* Different header for pages and posts if post_class() is being used */
.post h1, .post h2, .post h3 { /* whatever your actual h# tag(s) are */
font-family: Helvetica;
color: #111;
}
.page h1, .page h2, .page h3 {
font-family: Georgia;
color: #111
}
/* Individual post title by id like in alchymyth's example */
.post-title-23 {
font-family: Tahoma;
color: #222;
}
If the post_class is being used then the containing element for each post/page in a loop or on a single/page template will output a variety of useful css selectors you use to customize invidual elements more than you need.
Hope that helps.
Thank you so very much. I do believe this is what I was looking for.
If you would please mark this thread as "resolved" it would be appreciated. Helps everyone keep better track of whose issues are still outstanding. Thanks!
This topic has been closed to new replies.