PapaScott I like big blogs and I cannot lie! 🐘

Foo Content Bar

WordPress (which has now released 1.2) with its filtering capability makes it real easy to solve one of my formatting quirks, namely that I want my titles and permalinks inline with the content of each post, i.e. within the p-tags that are automatically inserted around the post. With MT I had to install a regex plugin to force in my strings. With WordPress, I define a simple filter, and by setting a priority, that filter is applied _before_ any tags are added.

It's really as simple as this:
function foo_content_bar($text) {
return 'foo'.$text.'bar';
}
add_filter('the_content','foo_content_bar',1);

(That last parameter to add_filter is the priority.)

comments powered by Disqus