Tagged with:

plugins

A Dear John

I’m so sorry TTFtitles… We’ve had some great times together but… I’ve found something better. *insert dramatic squirrel here*

The Facelift script (also available as a WP plugin) achieves image text replacement but without stripping the text tags (h1, h2 and so on) from your code, which helps improve your search engine ranking.

Also, the text becomes editable via css, which I find just lovely because makes it so much easier to manage and edit. When creating a WP theme I won’t have to rely on an external plugin, instead I simply put the script along with the theme-files. Much better, especially if you’re releasing the theme for download.

User friendly? Let’s say it like this: my knowledge in javascript doesn’t even qualify me as a noob and it took me about 30 minutes to completely figure out how everything worked and starting to modify it to suit the theme I’m working on. And I’m not using the plugin either, just the script. So yeah, it’s easy to use;)

ps. A “Dear John”-letter refers to a letter written by a woman to her husband or boyfriend to inform him their relationship is over, usually because she has found another man… (wikipedia) lol

Displaying pages and categories with the TTF Titles-plugin

The TTFTitles plugin

…lets you use images to replace the titles of your posts, thus circumventing the problem of guessing what fonts your end-users might have installed.

I.e. makes it possible for you to use whichever font you desire when creating a theme (at the cost of slightly raising your loading time though). I myself am a complete junkie for the plugin!

If you want to display a graphic menu of your categories and/or pages you can use the following code. (This is not my coding, only a modification of a function provided by a commenter named Ronnie on the TTFTitles-page.)

Categories:


< ?php
$cats = wp_list_categories('depth=1&title_li=&echo=0');
if ($cats)
{
preg_match_all('/]*>(.*)<\/a>/', $cats, $array);
$asize = count($array[0]);
for($i = 0; $i < $asize; $i++)
{
echo "";
the_ttftext($array[2][$i], $echo = true, $style="");
echo "";
}
}
? >

Pages:

< ?php
$pages = wp_list_pages('depth=1&title_li=&echo=0');
if ($pages)
{
preg_match_all('/]*>(.*)<\/a>/', $pages, $array);
$asize = count($array[0]);
for($i = 0; $i < $asize; $i++)
{
echo "";
the_ttftext($array[2][$i], $echo = true, $style="");
echo "";
}
}
? >

(You need to remove the whitespace between the question marks.)

Enjoy!