Gelflings At Play

Melinda Chambers Online – Photography and Poetry

Using John Leavitts’s TTF Titles Wordpress Plugin


Having just discovered John Leavitt’s wonderful TTF Titles Plugin, I wanted to share my discovery with those of you who might like to make use of it. It’s used to render text (particularly titles) into the font of your choice, rather than being constrained by the rather blah offerings of Micro$oft and Mac and what may or many not be stored on your readers’ computers. Between all of the helpful advice John provides on the plugin’s homepage, and a timely, kind word of advice from RT Richardson at ‘GothchiC-omic.com’ who I noticed had got the plugin working very well, I’ve finally managed to get it working for myself also. This is NOT to suggest there is anything wrong with the plugin, I simply know diddly squat about php and couldn’t figure out what went where.

With that in mind, here’s a quick and dirty guide for those using WordPress 2.3.3 and above who find themselves as php-challenged as I am!
(n.b Update 1st August 2009: I’ve since upgraded to WP 2.8.2 – no glitches whatsoever. Works exactly as it did with the previous version of WordPress.)

Blog Title
Changing the font of your blog’s title. Look in your header for:

            <?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?>

and replace with:

            <?php echo get_settings('home'); ?>/"><?php the_ttftext(get_bloginfo('name'),true,your style name); ?>

Post Title
Changing your post’s title. Look in your index, single post and page for:

           <?php the_permalink() ?>"><?php the_title(); ?>

and replace with:

           <?php the_permalink() ?>"><?php the_ttftext(get_the_title(), $echo = true, $style="your style name", $overrides=""); ?>

Text In The Body Of Your Post
Changing text within the body of the post:

           <?php the_ttftext(text*,true,your style name); ?>

Default Font
Alternatively, if you simply want to use the font you’ve set as the default font, you merely pop in the following:

          <?php the_ttftext(text*); ?>

With regard to the text you wish to change, if you are using more than one word (in other words, you have spaces e.g. Your Text, wrap the words in quotes like so:

          <?php the_ttftext("Your Text"); ?>

As far as styling default widgets and their titles like Pages, Archives, Recent Posts and Categories, apparently John is working on a solution for that one. I managed it with a number of items in my sidebar simply because I was using Text Widgets. Rather than using the space provided for their headings, I left that space blank and popped the widget’s title in body. I’m using WordPress 2.8.2 and an older template so I had to install the EXEC.php plugin to allow php to be written to posts, pages and widgets.

John’s TTT Titles plugin can be found here John Leavitt’s Wordpress Plugin
and help can be found here Templature – The TTFTitles WordPress Plugin

Having read through the comments, John has been extremely helpful and quick to respond with support for his plugin. Any errors in the code snippets above are most definitely my own and I’m more than happy to accept corrections.

August 2009 Additions:

Check List

I thought I’d add a visual check list for those of you still having problems using this plugin.

  1. Do you have a cache folder? When I installed this plugin one had to create this folder manually. Whether it comes as part and parcel of the updated version, I don’t know.
    TTF Cache Folder Location

    TTF Cache Folder Location

  2. Have you uploaded the font you wish to use?
    TTF Installed Fonts

    TTF Installed Fonts

  3. Have you chosen the style in which you wish your fonts to appear? (Click for a larger image. Opens in new tab.)
    TTF Font Styles

    TTF Font Styles

  4. n.b. I have set the style I’ve called “h3″ as my default text. This means I only have to use

              <?php the_ttftext(text); ?>

    to make it work within the body of a post or, if I so choose, within a text widget.

  5. Have you changed your header file within your theme editor to show your blog’s title in your chosen font? (Click for a larger image. Opens in new tab.)
    TTF Header - Blog Info

    TTF Header - Blog Info

  6. Have you changed your index (or home) file within your theme editor to show your posts’ titles in your chosen font? Don’t forget to also make these changes to both your single post and page php files! (Click for a larger image. Opens in new tab.)
    TTF Titles - Post Titles

    TTF Titles - Post Titles


© Melinda Chambers

© Melinda Chambers. All posts are the creation of the author and, as such, remain the author's property with all rights reserved.



Similar Posts:
  • Ah, this one's unique!

  Save To Del.icio.us Stumble it!

Previous Post:
«
Next Post:
»




Comments



1
Author:  An Cailin | Date:  Sunday 6th July 2008 | Time:  7:55 am

Thank you! Thank you! Thank you!

An Cailin’s last blog post..And now deep thoughts . . .

2
Author:  Molli | Date:  Monday 7th July 2008 | Time:  12:26 am

You’re most welcome! I’m glad to hear someone found this useful :-)
I took a look at what use you’ve made of the plugin on your site and it looks fantastic!

3
Author:  Jhie | Date:  Sunday 13th July 2008 | Time:  4:58 pm

Its so hard to make it work :( I downloaded it, extracted it, transferred it through FTP, activated it in my Wordpress…. and put the desired “code” in my title part. And yet, it still wasn’t working. Can you make a detailed step-by-step tutorial on how to install this plugin? :)

Jhie’s last blog post..Thick-faced feeler

4
Author:  Don Wilson | Date:  Tuesday 15th July 2008 | Time:  5:58 pm

Nicely done, what font do you use for your titles by the way?

Don Wilson’s last blog post..Reading for the first time

5
Author:  Molli | Date:  Tuesday 22nd July 2008 | Time:  12:45 am

Thanks Don. My titles are in Monotype Corsiva. I prefer cursive script over print, but wanted to ensure clarity so I went for a compromise :)

Jhie, did you change the permissions on your cache to be writable? That’s the only reason I can think of that would keep the plugin from working for you.

6
Author:  Dgold | Date:  Thursday 24th July 2008 | Time:  11:51 pm

Good post. Great plugin. I was using the Image Headlines plugin from Coldforged for a couple years before switching to this improved version TTF Titles.

I wanted to suggest this addition to the code in your tutorial. This is the code to put in-place of your post titles in your theme’s template, as described perfectly in the Gelflings At Play blog post above.

The WP Codex suggests always using a conditional “IF PLUGIN EXISTS”. With this, your blog will continue showing up even if the TTF Titles plugin is temporarily disabled for any reason.

Check out the code (hopefully this will show up)

I’m going to write it again without the brackets to make sur this comes thru

php if (function_exists(‘the_ttftitle’)) { the_ttftitle($before=”", $after=”", $echo=true, $style=”YOUR-TTF-STYLE-NAME-HERE”); }

Here is the Codex article where this is recommended,
http://codex.wordpress.org/Managing_Plugins#Hiding_Plugins_When_Deactivated

Hope this helps!

7
Author:  Dgold | Date:  Friday 25th July 2008 | Time:  3:23 am

Here’s an even better code. This has the If…. Else, so that your blog will display the TTF graphic when the plugin is installed / activated, but it will still work showing your ordinary text title whenever the plugin is deactivated.

php if (function_exists(‘the_ttftitle’)) { the_ttftitle($before=”", $after=”", $echo=true, $style=”radio-headlines”); } else { the_title(); }?

8
Author:  Molli | Date:  Friday 25th July 2008 | Time:  4:07 am

Thank you so much for that! At some point when a) it’s not four in the morning :p and b) I get my head back into coding-space I’ll be sure to point people towards your comment and make use of it myself! That helps immensely – thank you for taking the time to let me (and hopefully others) know about this :)

9
Author:  Mzheng???? » ???? » TTFTitles??Headline Images | Date:  Sunday 10th August 2008 | Time:  1:29 pm
10
Author:  Rostislav | Date:  Thursday 6th November 2008 | Time:  12:17 pm

Well done! Unlike the author of the topic ;-)

11
Author:  Linus Åkerlund | Date:  Monday 8th December 2008 | Time:  5:44 am

Hi

Please, please, please give me more specific information how to use TTFtitles to make plain text, e.g. “Text in the body of your post”, I really don’t understand where to put it in, Which page, where to put it for example. I’m a newbie to this so i pretty much don’t understand anything, but I’ve got the title to work thanks to you. The authors guide was really difficult to understand.

12
Author:  Molli | Date:  Monday 8th December 2008 | Time:  4:15 pm

Hi Linus,

When I post, I use the HTML editor, not the WYSIWYG (what you see is what you get) editor. This means I can see all of the formatting I use and type it in by hand when need be, rather than relying on WordPress to place things exactly as I want them. Possibly this will make things a tad more difficult for you if you’re not used to doing this.

Anyway, let’s say you want to put a photograph in your post and you’d like to put a fancy title beneath it. I see from your blog that you’re using WP 2.7-RC1, so your layout should be much the same as mine. Click on “Add New Post” at the top of the screen in your dashboard or on the left menu beneath Posts. In order for what I’m trying to explain here to show up, I’ve put spaces between all of the brackets so that they won’t actually run as html. eg. To show you the tag < p > (for a paragraph break), I’ve put a space after the first < and before the second >. The same applies when I’ve shown what to type in for your ttf title. I hope I’m not making this hideously confusing for you :(

Write whatever it is you’d like to say:

e.g.
This is a photo I took of Gordon Ramsay
< p >
< img src="http://akerlunddesign.se/dev/wp-content/gallery/pol/dsc_0200.jpg" >
< p >

Then. to pop a title beneath it, simply type in:

< ?php the_ttftext("Gordon Ramsay"); ? >

I hope this helps!

13
Author:  Nadiyah | Date:  Tuesday 9th December 2008 | Time:  10:42 am

THANK YOUUUU! I actually understood your instructions more than the orginial ones. Thanks again!

14
Author:  Linus Åkerlund | Date:  Wednesday 10th December 2008 | Time:  6:40 am

Hi

I’m doing exactly as you say, but it doesn’t work, altough I’ve tried another PHP command and that doesn’t work either and I know that work. Is there any command in WP where you can press on/off PHP working tags. Do you understand my question?

And thank you so much for the help! I’ve finally got what you mean =)

15
Author:  web site design Brisbane | Date:  Sunday 1st March 2009 | Time:  1:53 am

Nice post, you have just reminded me about how important design principles are.

16
Author:  Rob | Date:  Friday 31st July 2009 | Time:  5:21 pm

Install went great, configured, but tested went to crap. I am currently using WordPress 2.8.2.

When I use the tag nothing happens, in fact the words completely disappear. Of course I corrected your php on my site as php won’t fire off if there is a space between the open tag and the first question mark.

Everything seems to work widget-wise until I try to do something in a post using the ‘html’ editor.

17
Author:  amenodimeno | Date:  Saturday 1st August 2009 | Time:  4:57 am

That’s good man, keep it going.

18
Author:  Tarnya | Date:  Saturday 1st August 2009 | Time:  4:05 pm

Thank you so much. I wondered if you could add how to use TTFtitles in the navigation?

19
Author:  Molli | Date:  Saturday 1st August 2009 | Time:  11:32 pm

Hi Rob, can you show me an example of what you’ve actually typed into your html editor? Skip the opening and closing so the code doesn’t actually execute and I’ll see if I can puzzle out what’s happening. By the way, which fonts are you using? I’ve been back over to John Leavitt’s forum to refresh my memory on all of this stuff and it seems a lot of people were having problems with Open Type fonts, but True Type was fine. Also, I’ve updated the post above with some pics to show where the initial install is located, etc. and I hope this helps somewhat. The smaller images which open out into a legible size have been picking and choosing whether they display or not so please do let me know if you click on anything and it doesn’t link properly. I’m on dial-up here so I have the joy of timeouts to contend with on top of only having three brain cells to play with! :-)

Tarnya, you are welcome! :-) As I’ve just written to Rob, I wandered through the comment section on the plugin home page. A lot of people there were asking about using the plugin for widget titles and the like. I’m assuming you’re referring to the top line page menu? You didn’t link to a blog so I can’t be sure. Someone did offer up a solution for that but I’m not game to try it myself just now since I’m happy enough with how things are on my blog and simply don’t have the energy to go messing about with something I spent so long on well over a year ago. This is the code a gentleman called Ronnie offered up:

edit: I had to remove the code because there were a number of a href links in there which were executing and trying to disarm it, so to speak, made the code unintelligible. It’s here if you’d like to take a glance at it yourself. You’ll need to scroll through the comments to
“Comment by Ronnie
Made Monday, 11 of February , 2008 at 8:53 pm”

I’ve only taken a very quick glance at my theme files and the only place I can see where this code might go is…. oh, um, afraid I may have got your hopes up there. I just looked again and realised my initial thought was wrong. I can see
php wp_list_pages(‘depth=1&title_li=0&sort_column=menu_order’);

in the header but Ronnie’s code calls to WordPress Login and Out functions as well so I’m now thinking he’s intending it for the Pages Sidebar widget. That’s getting into your basic core files and that’s totally unfamiliar territory for me. I’m sorry! :-( Presumably you can call the_ttftext anywhere by using ‘get’
e.g

the_ttftext(get_wp_list_pages());

but I know there’s some drama with the echo and actually passing the result to ttftext. If that sounds like gobbledegook to you feel free to join me in my brain snap! :-)

This is going to bug me now! I’ll go back to John’s forum and have a rummage around to see if anyone else has offered up a solution – I’ve only read through to April of 2008’s comments thus far so I’m sure there are going to be some more suggestions – and possibly even one I can understand and implement! It’s not something I can do tonight, but I’ll definitely have a look within the week and post again if I find an update.

20
Author:  Molli | Date:  Sunday 2nd August 2009 | Time:  12:42 am

Hi again Tarnya, after a little more snooping around I found this link which may be of help to you: Working With the TTFTitles Plugin.

I’ll look around again when I’m not so bleary eyed and blurry brained and see if I can find anything more relevant to your query.

21
Author:  Rob | Date:  Sunday 2nd August 2009 | Time:  3:47 pm

I typed this:

in the body of the text. Of course I changed the ‘Your Text’ portion. I tried quotes, single quotes and no quotes but nothing seemed to work. I uploaded Adobes Hypatia font for the TTF, but I also test withthe other two the plugin came with annd neither seemed to work. In addition, I tried to make sure I was in the ‘html’ editor and not the graphical one when putting in the code.

Everything seems to be fin, until I use the tag. Anything I put within the single quotes simple disappears completely fromt he body fo the text.

22
Author:  Rob | Date:  Sunday 2nd August 2009 | Time:  3:48 pm

sorry. the tag didn’t appear in the post above.

23
Author:  Rob | Date:  Sunday 2nd August 2009 | Time:  3:49 pm

let’s try this.

<!– –>

If you don’t see the code above this line, i’m giving up. ;)

24
Author:  Molli | Date:  Sunday 2nd August 2009 | Time:  8:08 pm

Unfortunately, I only figured out what to do to make it work on my blog – I’m no genius when it comes to how the plugin actually works. PHP and I are not familiar friends. At any rate, do you have the Exec-PHP plugin? Here is the plugin zip file made by by Sören Weber if you don’t already have it. And here is his exhaustive documentation on it.
If you already have the Exec-PHP plugin installed, then I’m afraid I’m at a complete loss. As mentioned earlier, I fiddled around for ages with the TTF Titles plugin over a year ago and I can’t recall what sort of dramas I had with it, only that I didn’t know where to put things. I wish I could be of more help to you. Are you using it for your blog title and/or post titles? I’m just wondering if it’s only in the body of your posts that it’s failing to work.

25
Author:  adamoerikom | Date:  Sunday 20th September 2009 | Time:  7:30 am

Stunning blog and good article. High 5 for u man !

26
Author:  Gonzalo | Date:  Friday 11th December 2009 | Time:  2:11 pm

HELP!!!

Hi, great plugin, but I am having problems with special characters like á é í etc. The font HAS those characters, but when the image is rendered a box appears instead of those chars. Any idea?

27
Author:  Molli | Date:  Friday 11th December 2009 | Time:  5:59 pm

Hi Gonzalo,

Reading on John Leavitt’s homepage amongst the comments, I found someone else who had the same problem with accented letters and the like. It seems the problem might lie with the font. It seems TTF Titles doesn’t work very well (if at all) with OTF (Open Type Fonts), but only with TTF (True Type Fonts). The person who made this observation in John’s comment section said they found a True Type Font they liked containing the special characters she needed and now it all works perfectly. Will you take a look at your font type for me and see which it is?

28
Author:  Steve | Date:  Thursday 17th December 2009 | Time:  12:11 am

just wanted to say thanks for the info. sorted my problem with using more than on TTF Style. Thanks!

29
Author:  chun | Date:  Friday 25th December 2009 | Time:  1:48 am

thank you. the exec.php plugin fixed the main issue i was having!! merry christmas.

30
Author:  ????WordPress??????? « ???? | Seven’s Blog | Date:  Tuesday 12th January 2010 | Time:  10:50 am

[...] ??????????????????????? ?????http://gelflingsatplay.com/2008/03/26/using-john-leavittss-ttf-titles-wordpress-plugin/ 1 views Posted by Seven on November 5th, 2009 Tags: ????, WordPress, ??, ??, [...]



Write A Comment

Note: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>