• Resolved incluye

    (@incluye)


    I want to add some. The thing is, I don’t want to use :first-letter because the drop capital is supposed to be in a different (and non-standard) font—so I’m using Cufon, which doesn’t work with :first-letter. @font-face does, but it’s very temperamental and causes problems in IE and Webkit.

    Is there any way to add, say, a span to just the first letter of the post titles? I’ve seen a span added to the first letter of post entries before.

    Here’s a link to the site.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Seems to be a problem viewing this thread now (don’t know why)..

    Anyway, to answer your question… ??

    <?php
    $mytitle = get_the_title();
    $letters = substr($mytitle, 1);
    $firstletter = substr($mytitle, 0, 1);
    $newtitle = '<p>'.$firstletter.'</p>'.$letters;
    echo $newtitle;
    ?>

    Of course switch the paragraph tags for whatever you like..`

    Thread Starter incluye

    (@incluye)

    Brilliant! Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Drop caps on <?php the_title(); ?>’ is closed to new replies.