Tag Archives: ucc

How To List A Custom Post Type’s Taxonomies And Terms

I’ve been using the new [Twenty-Ten](http://wordpress.org/extend/themes/twentyten) theme for WordPress on my personal website; it’s great out of the box, but I wanted to display my custom post types and taxonomies in the same format as it uses for categories and tags. The function is broken into two parts: `ucc_get_terms()` returns a multidimensional array of the post’s taxonomy name(s) and each taxonomy’s term links; `ucc_get_terms_list()` gets the taxonomy information and formats the array for display in the template.

Continue reading

Adding A Custom Taxonomy Terms Widget To WordPress

The WordPress Categories Widget currently only handles the `category` taxonomy. I’ve modified it to allow the user to select a taxonomy, and tied in the Tag Cloud Widget code to give the user the choice of display formats: list, dropdown, and cloud. Multiple instances are possible, providing the user with an easy method for displaying links to user-built taxonomy terms.

`preg_replace_callback()` is used to fix the JavaScript for the dropdown menu; instead of generating the default `?query_var=value` format, it uses `get_term_link()` to generate the term URL.

Continue reading

How To Filter FeedWordPress Posts Into Custom Post Types

I like to hang out on [COLOURlovers](http://www.colourlovers.com/) every so often and follow (previously called favorite) palettes and colors from the queue to add to my library of design inspiration. I use [FeedWordPress](http://feedwordpress.radgeek.com/) to scrape [my personal RSS feeds from ColourLOVERS](http://www.colourlovers.com/rss) into my WordPress blog as individual posts, and then use a custom filter to turn the ColourLOVERS syndicated posts into a palette (or color) shortcode that I can then style as I like.

Before the advent of [custom post types](http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress), I used categories and tags to sort out my palettes and colors from the rest of my posts. However, it now seems more logical to add these into a custom post type rather than jamming them into a post.

What follows is the filter I have in functions.php that cleans up the syndicated post, and then changes the post type as appropriate. You’ll want to make changes of your own, as I’m using custom functions to clean up the data and recreate the post as a shorttag, as well as adding custom taxonomy entries.

Continue reading