I am looking to achieve something which I figured would be fairly simple to accomplish but it seems there are no real examples available to achieve my needs.
Essentially I have a custom post type of “Articles” for this custom post type I have a new taxonomy which I have registered which was created so that source publications can be added.
My goal was to be able to add an article through this custom post type and then select the applicable “source publication” from the term list so I could display where the article came from.
Now, the problem I am having seems to be simple… All I am trying to do is add some additional fields to the page where you can enter each taxonomy term. In this case I would like to add a field for “URL” and include an image for each source so I can add a logo.
So the question here is… how would I go about adding an additional field to each term?
I am assuming if wordpress does not allow for this functionality naively that somehow the “description” field could be utilized as a type of custom fields area and thus that the data can be stored there.
Then I am trying to of course extract the data out and display it.
I was able to customize the taxonomy column titles in case anyone is interest in the same way that columns can be modified for custom post types like this:
// CUSTOM TAXONOMY COLUMNS FOR CONTENT SOURCES
add_filter("manage_edit-content_sources_columns", 'content_sources_columns');
function content_sources_columns($content_sources_columns) {
$new_columns = array(
'cb' => '<input type="checkbox" />',
'name' => __('Name'),
// 'source_image' => '',
'description' => __('URL'),
'slug' => __('Slug'),
'posts' => __('Posts')
);
return $new_columns;
}
Hi @NetConstructor.com:
I wrote this last month for somebody and it may address what you are looking for. It is an example you would modify, not a complete ready-to-use solution:
Hope it helps.
Came across this post in my quest for likely the same thing, and not long after came across this plug in:
Ultimate Taxonomy Manager . I’m not endorsing it just yet, but I’ve tried it in a test environment and I think it does what you’re looking for. It feels a bit clumsy when retrieving the data, but that could just be me and my understanding of the documentation.
I think saving custom taxonomy meta/extra fields/custom fields in option table is something killing your site performance. Like if your site is heavy weighted(lots of visitor, lots of hits) then for large number of custom taxonomy the option table will be huge. and it will increase the load time for get_option() query for other plugins or I think this will hamper performance a lot. we should save unnecessary things in option table or increase rows in option table.
Your trying to modify the taxonomy by adding something that isn’t a taxonomy, which will only confuse.
Instead you’ll need to add a custom meta box to the article post type, and save the urls and image urls in custom fields. Then you would use the code to add columns in functions.php to look up those custom fields on the relevant post using
get_meta
A simpler and easier way would be:
WordPress Taxonomies Extra Fields the easy way - Bainternet