Zum Inhalt springen

Archiv für "Taxonomy"

Add class attribute to WordPress "the_tags" markup

I'm in the process of gradually enhancing my site's markup with microformats, in order to "indiewebify" my site further.
On thing I noticed while working on this at the Düsseldorf Indiewebcamp, is that WordPress (or the way my theme handles) tags on posts has no way to get an additional class inside the link markup. I noticed this while POSSEing to flickr -- my categories were transferred, my tags not so much, because the class="p-category" was missing. I found a way to modify the the_tags output by hooking into WP's term_links-$taxonomy filter in my theme's function.php.

Maybe there's a smarter ...

Add post format X to posts with category Y

Recently I decided to use the WordPress post formats in my blog. If you're not familiar with post formats, hop over to the wordpress codex and read about them there.

Back? Good. :-)

I now have the ability to use different layouts for different kinds of posts, like "video", "image" or "status" - there are some additional tweaks I need to add to my theme; currently not all of my blog's views are respecting the new post formats. Work in progress, as always.

The problem I was facing after enabling the post formats: How can I add the post format to the posts that have been published in the past?

The easy but time-consuming way would be to edit every post via the administration, but that'll take quite a while if you have more than handful of posts, so I looked for a way to set the post format directly in the database for the old posts.