[Resolved] Different font sizes in most recent post

Home Forums Support [Resolved] Different font sizes in most recent post

Home Forums Support Different font sizes in most recent post

  • This topic has 11 replies, 2 voices, and was last updated 9 years ago by Tom.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #84401
    Carlos Paramio

    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

    #84557
    Tom
    Lead Developer
    Lead Developer

    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/

    #84573
    Carlos Paramio

    Done
    Thank you very much

    #84798
    Tom
    Lead Developer
    Lead Developer

    You’re welcome!

    #84925
    Carlos Paramio

    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.

    #85163
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #85347
    Carlos Paramio

    Perfect
    Thank you

    PS: I took the liberty to mark this post as resolved, excuse me if I shouldn’t have done it

    #85370
    Tom
    Lead Developer
    Lead Developer

    You’re welcome!

    No problem! One less step for me πŸ™‚

    #90742
    Carlos Paramio

    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

    #91022
    Tom
    Lead Developer
    Lead Developer

    Try this function out instead – I added some code that should make it work on the first page:

    https://gist.github.com/generatepress/9163f26ce0f197541c85

    #91260
    Carlos Paramio

    Superb Tom

    Thank you very much for this excellent support

    #91307
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.