Image Headlines Plugin for WordPress 1.5

UPDATED: Version 2.8 released 11/14/05. Download now!

IMPORTANT NOTE: Please note that this plugin doesn’t support WordPress 2.X. However, you can find a wonderful remake here that does.

This plugin allows you to have images created automatically for your entry titles. In this way you can utilize non-standard fonts and get smoother rendering than would be possible with simple text headlines. New to this version is improved integration with the WordPress administration interface under WordPress 1.5 Strayhorn as well as genuine soft-shadows behind the text for that smooth, custom look the girls love. All of the titles you see on this site as well as all of the examples on this page were generated with this plugin.

This is an updated version of a plugin I released back in November of 2004, which is itself an updated version of a truly cool plugin released by Joel Bennett. Oh the tangled webs we weave.

If you have problems or questions, feel free to leave a comment here. There are currently ##comments WHERE comment_post_ID = 656″; echo $wpdb->get_var($sql);?>## comments about this plugin. Join the discussion!

If you end up using the plugin please drop into this thread and leave a comment with a link to your site. That way I can see what better designers than me came up with. Thanks!

If you like it…

Please note, if you find this or any of my plugins useful and feel the need to express your appreciation, I accept donations with a difference. Click the banner below to learn more.

Prerequisites

Your hosting provider must have GD and FreeType support compiled in to PHP for this plugin to work. If you don’t know what this means, ask your hosting provider.

Installation

IMPORTANT NOTE! As of version 1.4 of the WordPress Plugin Manager, TTF font files are not allowed elements of plugins. Hence, the bundled font is not installed correctly. You will need to download the tarball or ZIP file and install the font into the WordPress installation’s ‘wp-content/image-headlines’ directory. Sorry about that.

Your best bet is to first install the WordPress Plugin Manager and then perform a One-Click installation from there. That’s as simple as it gets. Failing that, you’re welcome to download the tarball and install it by placing the tarball in your WordPress installation’s wp-content directory and performing a [code]tar xvzf headline-image.tar.gz[/code]

That should get everything where it needs to go (there is also a zip file available for those that can’t use tarballs). You’ll then need to visit the plugins page of the WordPress administration and activate the plugin. See, don’t you wish you’d just used the Plugin Manager?


You must do this part

In order to have your titles turned into images, you have to change how you get your titles! Why? Well, if I went around changing every single invocation of the title into an image you’d have images in your RSS feeds and anywhere else you call “the_title()”. You don’t want that. Instead, you tell me which of your titles you want to be images. You do that by editing your template — for instance, your Main Template which generally controls how your home page will look — and search for the following text:

[code lang="php"]the_title();[/code]

Shouldn’t be hard to find. Make certain that this is the one you want changed, it might appear elsewhere in the file. This is the one somewhere after the “while (have_posts()) : the_post()” stuff. You’ll change this text to look like this instead:

[code lang="php"]the_title('-image-');[/code]

That’s it! What this does is tell the plugin “hey plugin, I want you to magically turn this into an image for me, alright?” And the plugin will, if everything is as it should be, turn it into an image for you. For increased accessibility you may wish to add an undisplayed span of text with the title as well, though to my mind the alt text provided in the image should suffice.


Using other fonts

The font I’ve included is the lovely Warp 1 by Alex Gollner. You can see more of his fonts here. However, if you’d like to use some other font you are more than welcome to do so. First, though, you need to get it on the server. So, find yourself a gorgeous TrueType font — preferably in Windows format if you have the choice — and stick it on your server. One of the easiest ways is to use the built-in WordPress Upload utility. You’ll have to allow ttf files to be uploaded which you can change in the miscellaneous tab of your WordPress Options, but once you do that it’s literally just a few clicks to install the font. Simply click the “Upload” tab in WordPress administration, browse to your font (note that Windows is finicky with the file dialog around fonts… you’ll have to right-click on your file and hit “Properties…” and copy the filename from the properties and paste it into your file name box in the “Open…” dialog) and upload it! The plugin automatically searches your configured upload directory as well as the wp-content/image-headlines directory for valid TrueType fonts and lists those in the menu. Experiment with those fonts!

Configuration

Following installation you’ll likely want to configure the appearance of your titles. Simply go to the Options page of your WordPress installation where you’ll see a new option cunningly called “Headlines”. Click it.

If everything has gone well with the installation you should see a collection of options and a nifty preview image of what your current settings look like. Yeah! Note that if your preview image is showing (it should be an image with “The quick brown fox jumped over the lazy dog.” in red letters with a soft gray background shadow) you are good to go. You’re welcome to customize it however you wish but as far as the plugin is concerned it’s a happy camper.

Let’s talk options.


General Configuration

Really if you’re up and running you have nothing much to do here. Most of this just sets what directory the plugin will use to store the images it generates. You can change it if you wish.

Image Caching

You have control over how long the plugin will store images in the image cache. Why does the plugin cache images instead of generating them on-the-fly every time? Because it takes work to generate those images… sometimes — especially when using those pretty soft-shadows — a lot of work. Asking the web server to generate those images from scratch every time is burdensome. So, the plugin saves the image upon creation. The next time that particular title is displayed the web server can simply return that previously-created image and save a lot of work.

There’s a trade-off though, of course. Storage. Those images take up space. And if you have, say, 600 posts, that’s 600 images that would be stored. The plugin lets you decide how long to keep those images in the cache based on the age of the image. The default is 14 days, meaning that any image that was created 14 days ago will be deleted sometime today. This simply means that if someone views an archive post from, say, last year it is likely that the plugin will need to recreate the image before it can be displayed. Once created it will hang around in the cache for the configured time and then get deleted again. You can select any number of days to suit your needs. Please note that all of this caching and the management of the image files within the cache is transparent to you and to your readers.

Font and Colors

As you might imagine this section will have the greatest bearing on the appearance of your titles. You’ll see a menu containing the list of available fonts and entry boxes for controlling the font size and color as well as what the background looks like. Note that all colors you see on this page must be specified in HTML color format, so #123456 or #FF0000 or even the shorthand version like #CCC. Anything else will break in fantastic and undefined ways and I will not be pleased if you ask me why your images aren’t showing up and it turns out that you have GREEN in the color field. You’ve been warned!

If you make your background transparent it will likely look better. Turn the option on and off to see the difference.

You can have a background image displayed behind your text if you want. I don’t use it much but that’s your call.

Line Spacing

This will control the formatting of your image a bit, especially as it pertains to long lines.

The left padding simply tells the plugin to leave some blank space at the left edge before it starts drawing the text. This may be useful in the case where you have a background image you want to include.

You can enable the line-splitting option so that really long titles get split into multiple lines before rendering. This is important on fixed-width blogs — like the default Kubrick template in WordPress, for instance — so that you don’t break the appearance if you happen to spout off in your titles like I do. Selecting this option will break the text into multiple lines if the rendered line would exceed the maximum line width you specify.

The vertical space is the additional space you want between each line in the case that we break up lines. The bigger the number the larger the gap between them.

The line indent is the additional space between the left border of the image and any subsequent lines in the case of a line break.


Shadows

You can turn shadows completely off if you so desire. In which case, simply turn off that “Enable shadow” checkbox. But where’s the fun in that? You have your choice of two shadow styles: soft-shadows and so-called “classic” shadows. Here’s the explanation of both:

Soft Shadows

Soft shadows look like the shadows that Adobe Photoshop generates for you. All of the examples on this page except for the “exciting” one are soft-shadowed. They are generated by drawing the text in the color that you specify in the shadow color parameter after first offsetting the text by the amounts that you specify in the vertical and horizontal offset parameters. Once that’s drawn the entire shadow image is blurred mathematically. If you care about the nitty-gritty details, it performs an approximation of a Gaussian blur using a “squares” convolution kernel horizontally and vertically across the image, with the size of the kernel being based on the “shadow spread” parameter given. If you don’t care about the nitty gritty, think about blurring your eyes and looking at the text: the amount you blur your eyes is controlled by the “shadow spread” parameter. A small spread means that the shadow will be pretty well defined. A larger spread will mean that the shadow is spread out more and more diffuse (as well as the color tends to fade as the spread increases).

PLEASE NOTE that large shadows means many more calculations and many more calculations means it is slower to calculate the final image and making it slower means using CPU time on the server and using too much CPU time makes ISP admins cry. Once a particular image for a particular title is created it doesn’t have to be created again, so you don’t have to worry about constantly performing this calculation. But, take it from me, if you have a large spread on a large text size it can take 20 seconds to calculate the shadow for it. And that’s 20 seconds of 99% CPU utilization on the server processor which can create problems with certain hosts. You’ve been warned again.

“Classic” Shadows

Classic shadows are pretty simple. First, we draw shadow two in the color you specify, and we draw it 2 times the number of pixels you specify in the offset parameter down and to the right of where the final text will be drawn. Then we draw shadow one in the color you specify, and we draw it the number of pixels you specify in the offset parameter down and to the right. Then we draw the text in your font color right where you want it. The “exciting” example on this page is an example using this method. Using this technique has the advantage that it’s fast. Using this technique has the disadvantage that it’s ugly. Okay, not ugly, just not as elegant and stylish as the soft ones. Then again I’m biased… I wrote the soft shadows and Joel Bennett did the classic ones :) . Nevertheless, you can create some interesting effects with the classic shadows.

Can I use it for things other than titles?

Glad you asked! You can stick this anywhere in your templates — for instance if you want your various category titles rendered — or even in your posts and pages like the one above. First, if you want to put these images in your posts like this — say for fancy dropcaps — you’ll need a very helpful plugin aside from the Image Headline plugin. Go and find the RunPHP plugin. Install it. Then, wherever you want your text to appear, put in a call to the following function (if in a page or post, be sure to enable the “eval() Content” option):

[code lang="php"][/code]

Where the ‘formats’ string is a list of formats that you want to override separated by ampersands (&). Anything you don’t specify will be set exactly as it is for your entry titles. Each format will be in the form of ‘format_name=value’ where ‘format_name’ is defined as follows:

So, if I want to set the font color to red, the size to 20 points, and the shadow spread to 5 pixels the format string would be:

[code lang="php"]'font_color=#F00&font_size=20&shadow_spread=5'[/code]

26 Responses to “Image Headlines Plugin for WordPress 1.5”

  1. 1

    Footsteps in the Mirror » The Very Long List Of Things… - June 2nd, 2005

    [...] ] Browser Sniff Category Image(s) Paged Comment Editing Enhanced Post List Gravatars Headline Images – not implemented yet because I& [...]

  2. 2

    The Benjo Blog » Blog Archive » New Plugin Part Deux - June 6th, 2005

    [...] ity. If you like the way the titles of my blog posts look, you can find the plugin here: Image Headlines Plugin for WordPress 1.5.

    Permalink | Trackback | [...]

  3. 3

    coldforged.org » Blog Archive » New Image Headline Plugin is finally ready - June 7th, 2005

    [...] soft shadows. Easier than ever to configure. So, if you’re ready to take a gander, go on and tell me what you think. If you do end up using the plugin, please le [...]

  4. 4

    coldforged.org » Blog Archive » Image Headlines plugin updated - June 7th, 2005

    [...] cause for awe and celebration. Such is the case for the update I’ve released for the Image Headlines plugin. Many people have asked for the ability to clear out th [...]

  5. 5

    EMT手札 » [Plugins] Headline Images的增加 - June 8th, 2005

    [...] 片耶…感覺很特別 去Guestbook詢問了站長後站長提供了Plugin的網址 Headline image http://www.coldforged.org/image-headlines-plugin-for-wordpress-15/ [...]

  6. 6

    孟婆湯 » headlines Image測試成功 - June 9th, 2005

    [...] Filed under: 新聞, 學而時習之 — 飛天鯨 @ 4:26 pm new installed: headline image easy-options manage-theme-files 感謝lancetw è‡ªç”±è»Ÿé« [...]

  7. 7

    toxic-mind.com » Neues Plugin für mein Blog - June 9th, 2005

    [...] Posted on Donnerstag 9 Juni 2005 Heut habe ich mir mal von [...]

  8. 8

    subdivision.co.uk » Blog Archive » Wordpress - June 12th, 2005

    [...] ing Drupal) I also configured it to automatically create PNG images for headlines using a headline images plugin, which is very cool – it means you can have any font yo [...]

  9. 9

    shorty114.net » Archives » Time Since Revisited - June 13th, 2005

    [...] plugin, which shows the period of the day in which the post was posted. And I also put in image headlines. Filed under This Site. This entry [...]

  10. 10

    Chetan’s monologue » Font freakonomy - June 19th, 2005

    [...] nabled cleartype or font-smoothening. Too soft. Please don’t talk about embedding or imaging fonts that are available for print. They’re no doubt beautiful, [...]

  11. 11

    thehtmlartist.com » Blog Archive » Fancy Image Headlines - June 27th, 2005

    [...] y happy with the look format of my blog entries. It all started when I decided to use the Image Headlines plugin for WordPress. I thought a nice fancy font would look [...]

  12. 12

    lifebsideben » Blog Archive » Upgrade fun - February 6th, 2006

    [...] Upgrade fun Tags: freetype, linux, php, plugins, wordpress I really wanted to try out this WordPress plugin called ImageHeadlines that created images of your title headlines from any TrueType font. It’s a neat idea, and you can make your headlines really look cool with dropshadows, etc. One not-so-minor problem: my PHP install doesn’t have a working FreeType installation. “Well, time to fix that,” I figured. [...]

  13. 13

    Development on a Shoestring » New WordPress plugin - Image Replacement - February 9th, 2006

    [...] The obvious question is: Why create a plugin to do this when a perfectly good one already exists? Firstly let me say this is in no way a disparagement of the Image Headlines plugin, which is very cool, I just wanted a different way of doing it. With the Image Headlines plugin, you need to edit your template files to set which template tags you wanted to replace, which I’m far too lazy to do. Also, if I disabled the plugin it broke my template becuase it left -image- in front of the text. I also could have fixed this, but as I said, lazy. The other reason was that if people have images turned off then they see the ugly alt text (in IE anyway, Firefox just displays it as plain, styelable text, but IE seems to need to highlight the fact that there’s a broken image [...]

  14. 14

    C’est la vie! » Blog Archive » Modified the previous one - February 11th, 2006

    [...] – Headline Images Noticeable, from the post title. – Dunstan’s Time Since Have been using it already since I still had the previous modified Plain Vanilla theme. – Limit Posts But why do I limit the post? I oftenly have long post and I’ve rarely used ‘more’ tag on my previous posts. So I limit the post due to the column I have below. It won’t sound so nice to see it under a very long post, anyway. – Recent Commenters Just what I have on the red column. Doesn’t look nice yet in IE. [...]

  15. 15

    Hosting from Matt Fletcher » Blog Archive » Hacking Image Headlines - February 15th, 2006

    [...] I have been playing with the Image Headlines Plugin from coldforged.org after Graham recommended it to me. You can see the effects in the titles of my posts. [...]

  16. 16

    Telagon Sichelputzer » WP Plugin: Image Headlines - February 17th, 2006

    [...] Ich habe vorhin noch etwas schönes entdeckt, um Überschriften in WordPress Blogs auch mit jedweder TTF Schriftart darzustellen. Image Headlines Plugin erstellt ein serverseitiges Bild der Überschrift, welches sich mit maximalen Maßangaben und natürlich den Farb- und Größeninformationen relativ frei gestalten läßt. Auch akzeptable Schatten kann man hinter den Text legen. Vielleicht werden wir das ganze für den (Re-)Launch der Campuszeitung.de Webseite unserer Universität nutzen… mal schaun! Keywords/Tags: WP Plugin, WordPress, Plugin, Image Headlines [...]

  17. 17

    Image titles « Plus Ping - February 17th, 2006

    [...] Link [...]

  18. 18

    Lorelle on WordPress » Image Replacement Techniques - February 20th, 2006

    [...] ColdForged – Image Headlines Plugin for WordPress [...]

  19. 19

    走向云和山的彼端 » ImageHeadline插件 - February 22nd, 2006

    [...] 准备为这里增加ImageHeadline插件,ImageHeadlines Plugin for WordPress 1.5 暂时还不知道是否支持2.0。是不是还需要php支持ttf?暂时还没仔细查看官方Doc,但是觉得蛮有用的。 [...]

  20. 20

    Templaterie Blog - February 25th, 2006

    [...] Was ich sehr schön finde, leider viel zu selten, daß er seine verwendeten Plugins listet >>. Besonders zu erwähnen ist dabei das Plugin Headline Images. Es sorgt dafür, daß bestimmte Überschriften grafisch dargestellt werden. Und er hat dabei eine wirklich schicke Schriftart gewählt, so daß das Design nochmals um eine Ecke besser aussieht. Und wohlweislich hat er darauf verzichtet, Artikelüberschriften nicht grafisch abzubilden (Google…). [...]

  21. 21

    Immernoch kein Content, dafür aber tolle Spielereien! at delbrouck.org - February 28th, 2006

    [...] Wollte ich nur mal angemerkt haben. Die Seite kann jetzt Titel als Grafik — ‘automagisch’ umgewandelt! Toll, oder? Achja, das macht natürlich ein Plugin: Image-Headlines, eigentlich wohl für WP 1.5, funktioniert aber auch (wie man sieht) grossartig mit der latest, greatest, bleeding edge 2er Version. [...]

  22. 22

    chitime blog » Blog Archive » Plugin “Image Headlines”. - March 2nd, 2006

    [...] Lieber Tulek, schönen Dank für den Link zum Plugin! :-) Nu bin ich aber zu müde. Das probiere ich morgen aus. Für alle anderen: Es geht um ein Plugin, das die Überschriften anders anzeigt. gähn Aber das seht Ihr ja dann…! :-)   tags:überschrift, image geadlines, plugin, tulek, [blog ]technisches. [...]

  23. 23

    arkoudos.com » Blog Archive » Σχεδίαση - March 3rd, 2006

    [...] Headline Images [...]

  24. 24

    海豚微笑的背后 » Blog Archive » 本站所使用的插件 - March 7th, 2006

    [...]   在BloggingPro China上发起如此活动,自己不写说不过去,嘿嘿。 Extended Live Archives:存档插件,使用AJAX技术,使得汇总文章更加方便,实际效果可以看这里。 Akismet:防止Spam插件,WP官方推荐,有很好的效果和简便的操作。 Intypo:这个插件是为了解决WP的引号问题用的,WP默认会根据本地语言来转换引号,有时会带来困扰。 Headline Images:标题图形化插件,效果请直接看本站标题。 中文 WordPress 工具箱:随机文章,最新留言,留言最多文章,发表评论最多的网友,还有真正的文章摘要,等等。 Quoter:留言引用,WP缺乏比较明晰的一对一回复机制,这个插件能有一定程度改善。 Google Sitemaps:生成Google Sitemaps标准的XML文件。 iG:Syntax Hiliter:代码高亮显示,此类插件其实有很多,这个我只是用的比较顺手。 WP-SingleMP3:flash效果的mp3播放插件。 WP lightbox JS:图片暗箱效果,效果可以看这里。 WordPress Database Backup:自动备份数据库,WP官方推荐,和WP-Cron结合使用可以做到每日自动备份数据库到邮箱。 WP-Cron:定时做某些工作,我只是用来自动发送备份数据库用。 [...]

  25. 25

    Tony (5 comments) - May 4th, 2010

    Will this work with wordpress 2.9.2?

  26. 26

    ColdForged (972 comments) - May 4th, 2010

    Will this work with wordpress 2.9.2?

    No. Please see the note at the top of the page.

Leave a Reply

Comments links could be nofollow free.