More WordPress Pimping

PHP and CSS and all that funky web design stuff are funky, because they are so easy to use and you quickly get results. I like it.

I’ve decided to release my first plugin into the world (it’s big hack, but it has turned out to be very useful on my other blog http://info1.blackhc.net).

It supports 3 text replacements:

Xkcd-style Tooltips as Replacement for Footnotes

Example:

[[:This is a default footnote. Hover over it to display it.]]

Result:

´

You can use a different marker, too:
Example:

[[:My Footnote#This is a default footnote. Hover over it to display it.]]

Result:
My Footnote

Linking to Wikipedia

Example:

[[wikipedia:Pie]]

Result:

Pie

The link text can be changed, too, of course.
Example (you can use : as seperator, too):

[[wikipedia:pi#Fake Pie]]

Result:

Fake Pie

Expandable Text

Example:

[[expandable#Expandable Text...]]

Result:

The link text can be changed, too:
Example:

[[expandable#Click me! Click me! Pleeease!#Yay!]]

Result:

And we can nest it and it works with other tags.
Example:

[[expandable:#Expandable Text...

[[expandable:Click me! Click me! Pleeease!#Yay!]]
// some Java code

]]

Result:

We can also use a Heredoc-like mode:
Example:

[[expandable_ex:EOD#Heredoc-like Expandable#[[[[[[[]][[EOD]]

Result:

Escaping [[ and ]]

Example:

Escaping [[escape_left]] and [[escape_right]]

Source Code

Hopefully this can be useful for somebody else, too.
Cheers,
Andreas

This entry was posted in Check This Out!, Coding, PHP, Web and tagged , , . Bookmark the permalink.

One Response to More WordPress Pimping

  1. Pingback: More WordPress Pimping | PHP-Blog.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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