Archived topic
Different font sizes in most recent post
11 replies · Started by Carlos Paramio on March 9, 2015
Is there any way to set different (bigger) title and excerpt font sizes for the most recent post only?
Maybe with the post-ID?
With your support I'm getting closer to complete this project
Thank you, merci, thank you
This PHP snippet should add a usable class to the first post: http://wpsnipp.com/index.php/functions-php/add-class-to-first-post-in-the-loop/
Done
Thank you very much
You're welcome!
Unfortunately each change I make in that new class is reflected when normal pages (not posts) are loaded.
I suppose WP takes the page as if it were the first post of the blog.
You can target the posts that belong to the blog only by doing this:
.blog .first,
.archive .first {
/* CSS in here */
}
That should do it :)
Perfect
Thank you
PS: I took the liberty to mark this post as resolved, excuse me if I shouldn't have done it
You're welcome!
No problem! One less step for me :)
Unfourtunately, there's another bug in this solution:
Each time you click on "Load more" in masonry, the first post to load gets the customization that is set in that new class.
Any ideas?
Thanks
Try this function out instead - I added some code that should make it work on the first page:
Superb Tom
Thank you very much for this excellent support
No problem! :)