• Resolved cyberquill

    (@cyberquill)


    I added a rather large RSS icon plus a Google ad block to the top of my blog.

    Problem is, when the headline of the first post on the page is long (especially when the font is set to “large” or “largest” in IE), then it runs right over the RSS icon and sometimes even the Google ad block. (The current headline you see at the top “The Ministry of Silly Counts” simply isn’t long enough to cause a problem, even when set to “largest.” But longer headlines do run into the RSS icon.)

    In order to prevent this, I gave my headlines a maximum width:

    h2 {max-width:400px}

    That way, the headline breaks right before the word that would run into the RSS icon, and no collision occurs.

    Understandably yet unfortunately, now the line break happens in every h2 headline on the page, not just in the first one on top. So if you scroll down the main page of my blog, for example the 4th post is headlined:

    Be Fruitful and Join the
    Dinosaurs

    Unless your font is set to small, you’ll see that the headline breaks. Obviously, there’s no need for the line to break because there’s nothing it might run into.

    (On the single post page of this very entry, of course, the line break is perfect, because otherwise the dinosaurs would run over my RSS icon.)

    How can I give a maximum width ONLY to the first headline on the page and leave all other headlines unbroken?

Viewing 5 replies - 1 through 5 (of 5 total)
  • you could have a look into this (just apply it to the h2 only):
    http://wordpress.org/support/topic/302408?replies=6

    Thread Starter cyberquill

    (@cyberquill)

    Thank you. I tried your suggestion, and it works like a charm.

    Thread Starter cyberquill

    (@cyberquill)

    Follow-up question:

    I’m using the <!–more–> tag on all my posts. How can I set it so the <!–more–> tag will be ignored for the first post on the index page so that only the first post is displayed in full?

    fredrix

    (@fredrix)

    I am trying to break the post headline after a colon.

    example below>

    Financial Meltdown:
    Perpetrators Still Perpetrating

    Could you tell me how to accomplish this?
    Many thanks!

    Michael

    (@alchymyth)

    instead:
    <?php the_title(); ?>

    try and use:
    <?php echo str_replace(':',':<br />',get_the_title()); ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to line-break ONLY the first headline on the page?’ is closed to new replies.