Mar 11 2008

Wordpress Post Classes plugin v0.1

This plugin has been superseded by the much-improved Semantic Classes plugin

I’ve written a small Wordpress plugin that provides some new template tags that return a post’s tags, categories, author, and date; useful for CSS trickery.

You can view its page here.

This initial release provides the following items:

<?php generate_tag_class(); ?>
This function returns a space-delineated list of the post’s tags, prefixed with ‘tag-’
e.g. tag-politics tag-election-2008
<?php generate_category_class(); ?>
This function returns a space-delinated list of the post’s categories, prefixed with ‘category-’
e.g. category-personal category-random-thoughts
<?php generate_author_class(); ?>
This function returns the author name of a post, prefixed with ‘author-’
e.g. author-Heliologue
<?php generate_date_class(); ?>
This function returns a space-delineated list of the post’s date, prefixed with ‘y’ (year), ‘m’ (month), and ‘d’ (day).
e.g. y2008 m03 d11

4 Responses to “Wordpress Post Classes plugin v0.1”

  1. Heliologue says:

    Yes, I credit Scott Wallick in the readme. This plugin is inspired by—and reuses some code from—Sandbox/Barthelme. Lot of it is just moving functionality from his functions.php to a separate plugin, so as to be more portable.

  2. Rob says:

    I didn’t mean to imply any intellectual theft, good sir!

  3. Heliologue says:

    I didn’t figure as much. Just wanted to acknowledge that you were right in pointing out the source.

Trackback URI Comments RSS

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite="" title=""> <code> <em> <i> <img alt="" src=""> <li> <ol> <p> <span> <strike> <strong> <ul>