by ShibaShake

Would you like to add new custom fields to your WordPress posts, pages, and categories? Now you can easily do this with the WordPress custom taxonomy system. For example, if you have a blog on music reviews, you may want to add the fields Artist and Genre to each of your posts. Here is an example movie blog that showcases the power of custom taxonomies.

What is less clear, however, is how you can expand your WordPress admin interface, so that users can easily enter in these new custom fields. WordPress 2.8+ will only include an input interface for custom taxonomies associated with posts. In addition, this input interface is the standard tag interface, where you must type in the new fields as plain text.

If you are looking for a drop-down menu, or a radio button list, you are out of luck.

Here, we consider how you can flexibly expand your WordPress post interface and style your custom taxonomy input panel however you want.



Screen-shot of the tag input interface associated with all custom taxonomies.

1. Create Your WordPress Custom Taxonomy

First, we create a simple test attribute called theme and we associate it with our WordPress posts. We add three initial terms to our new theme attribute – Beauty, Halloween, and Dragons.

Note that the hierarchical argument simply refers to whether your new theme attribute is a hierarchical structure, such as your WordPress categories, or whether it is flat, such as your WordPress tags.

The hierarchical argument does not currently affect the input interface of your new attribute. As of WordPress 2.8, the normal tag input interface will be used for all custom taxonomy attributes. To restyle the custom taxonomy input interface, you must use the add_meta_box command.

1
2
3
4
5
6
7
8
9
10
11
add_action( 'init', 'create_theme_taxonomy', 0 );
 
function create_theme_taxonomy() {
	if (!is_taxonomy('theme')) {
		register_taxonomy( 'theme', 'post', array( 'hierarchical' => false, 'label' => __('Theme'), 'query_var' => 'theme', 'rewrite' => array( 'slug' => 'theme' ) ) );
 
		wp_insert_term('Beauty', 'theme');
		wp_insert_term('Dragons', 'theme');
		wp_insert_term('Halloween', 'theme');
	}
}

2. Styling Your Custom Taxonomy Input

To add input menus to your WordPress post interface, you want to use the WordPress add_meta_box command. In the example code below, we add a new custom field called Theme into our WordPress post interface. Simply include the code into your functions.php theme or plugin file.

1
2
3
4
5
6
7
8
9
10
11
12
13
function add_theme_box() {
	add_meta_box('theme_box_ID', __('Theme'), 'your_styling_function', 'post', 'side', 'core');
}	
 
function add_theme_menus() {
 
	if ( ! is_admin() )
		return;
 
	add_action('admin_menu', 'add_theme_box');
}
 
add_theme_menus();


Screen-shot of your new drop-down custom taxonomy interface.

The add_meta_box function adds your_styling_function to the WordPress blog system so that it gets called whenever the Edit Post screen is rendered. You can use the same function to add input code to Edit Page and Edit Link screens.

The example your_styling_function below will add a drop-down menu to your blog Edit Post screen, containing all the current terms on your theme custom taxonomy.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// This function gets called in edit-form-advanced.php
function your_styling_function($post) {
 
	echo '<input type="hidden" name="taxonomy_noncename" id="taxonomy_noncename" value="' . 
    		wp_create_nonce( 'taxonomy_theme' ) . '" />';
 
 
	// Get all theme taxonomy terms
	$themes = get_terms('theme', 'hide_empty=0'); 
 
?>
<select name='post_theme' id='post_theme'>
	<!-- Display themes as options -->
    <?php 
        $names = wp_get_object_terms($post->ID, 'theme'); 
        ?>
        <option class='theme-option' value='' 
        <?php if (!count($names)) echo "selected";?>>None</option>
        <?php
	foreach ($themes as $theme) {
		if (!is_wp_error($names) && !empty($names) && !strcmp($theme->slug, $names[0]->slug)) 
			echo "<option class='theme-option' value='" . $theme->slug . "' selected>" . $theme->name . "</option>\n"; 
		else
			echo "<option class='theme-option' value='" . $theme->slug . "'>" . $theme->name . "</option>\n"; 
	}
   ?>
</select>    
<?php
}

Lines 4-5 – Add security nonce check.
Line 9 – We use the hide_empty=0 argument for the get_terms function so that all theme choices will be returned, even the ones that have not yet been assigned to any post.
Line 15 – We use the wp_get_object_terms function to get the theme currently associated with our post so that we may pre-select it in our drop-down menu.
Lines 17-25 – Render our drop-down menu, populating it with our theme names.
Note – On lines 22 and 24, we are now setting the theme-option value to $theme->slug. As pointed out by Adam in the comments section, the taxonomy object slug is unique (unlike its name), and this will prevent duplicate taxonomy terms from being created.



Screen-shot of the Edit Post, which now has the old tag input box and the new drop-down menu box.

Note that when you add your new drop-down menu box, the old tag input box will still appear. To only include one input box, use the remove_meta_box command as suggested by Leo Mysor in the comments section below.

remove_meta_box('tagsdiv-theme','post','core');

You can add the remove_meta_box command before your add_meta_box statement.

Alternatively, you can register your custom taxonomy attribute to something other than ‘post’. In the code example below, we register our theme custom taxonomy to shiba_post, which gets rid of the standard tag input box in the Edit Post screen.

register_taxonomy( 'theme', 'shiba_post', array( 'hierarchical' => false, 'label' => __('Theme'), 'query_var' => 'theme', 'rewrite' => array( 'slug' => 'theme' ) ) );

However, as pointed out by Leo, this also removes your taxonomy tab from the Posts menu and makes it difficult for others to add new items to your taxonomy.

3. Saving Your New Inputs

Now, we can insert any input panel we want for our custom taxonomy, however, we still need a way to save those input values. This can be achieved with the save_post WordPress hook. This hook allows you to execute a function of your choice when a WordPress post gets saved. There are similar hooks for saving pages and links.

Just add the save_post hook to your existing add_theme_menus function. For example, the code below registers the save_taxonomy_data function with the WordPress blog system so that it gets executed whenever a WordPress post is saved or updated.

1
2
3
4
5
6
7
8
9
10
function add_theme_menus() {
 
	if ( ! is_admin() )
		return;
 
	add_action('admin_menu', 'add_theme_box');
 
	/* Use the save_post action to save new post data */
	add_action('save_post', 'save_taxonomy_data');
}

Now, you just need to specify your save_taxonomy_data function. We can adapt our own save function from the add_meta_data example on WordPress.org.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function save_taxonomy_data($post_id) {
// verify this came from our screen and with proper authorization.
 
 	if ( !wp_verify_nonce( $_POST['taxonomy_noncename'], 'taxonomy_theme' )) {
    	return $post_id;
  	}
 
  	// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything
  	if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) 
    	return $post_id;
 
 
  	// Check permissions
  	if ( 'page' == $_POST['post_type'] ) {
    	if ( !current_user_can( 'edit_page', $post_id ) )
      		return $post_id;
  	} else {
    	if ( !current_user_can( 'edit_post', $post_id ) )
      	return $post_id;
  	}
 
  	// OK, we're authenticated: we need to find and save the data
	$post = get_post($post_id);
	if (($post->post_type == 'post') || ($post->post_type == 'page')) { 
           // OR $post->post_type != 'revision'
           $theme = $_POST['post_theme'];
	   wp_set_object_terms( $post_id, $theme, 'theme' );
        }
	return $theme;
 
}

Lines 4-6 – First we do a nonce check to ensure that the function is being called by our very own your_styling_function. Make sure that the taxonomy_noncename and taxonomy_theme terms match those that were created earlier, on lines 4-5 in your_styling_function.

Lines 9-10 – Take no action for auto-saves.

Lines 14-20 – Check that the current user has proper permissions to edit posts.

Lines 23-28 – Associates our post with the new theme taxonomy data. It is important to do a post_type check here, because this function will also get called on post revision objects.

As pointed out by Angelia, this results in double counting the newly added taxonomy relationship.

4. Getting a Taxonomy Term Count

If you want to get the count of a particular taxonomy term, i.e., the number of objects that it is associated with, you can easily extract that figure from the WordPress term_taxonomy database.

Just add the count code into the foreach $themes loop.

global $wpdb;
	foreach ($themes as $theme) {
 
	   $count = $wpdb->get_var( $wpdb->prepare( "SELECT count FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $theme->term_taxonomy_id) );
 
           /* Your code here to display the count ... */
          }

While registering your custom taxonomy, you can link an update_count_callback function to it. This function will get called every time any term in your taxonomy gets a count update. This allows you to control what actually gets stored in the count column of your custom taxonomy terms.

        $args = array( 'hierarchical' => false, 
                            'update_count_callback' => 'test_taxonomy_count', 
                            'label' => __('Theme'), 
                            'query_var' => 'theme', 
                            'rewrite' => array( 'slug' => 'theme' ) )
	register_taxonomy( 'theme', 'post',  $args);
 
// This test count function just does the default WordPress operations
function test_taxonomy_count($terms) {
	 global $wpdb;
	 $terms = array_map('intval', $terms);
 
         foreach ( (array) $terms as $term) {
	   $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term) );
	   $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) );
         }
}

5. All Done!

You can use the same code to style your custom taxonomy input panels for pages and links. Just change the post attribute to page or link when calling add_meta_box and use the save_page, edit_link, and add_link hooks instead of save_post.

You can also add new fields to your WordPress blog categories using a similar system.

Related Articles

<< Previous Next >>

<a href="http://shibashake.com/wordpress-theme/wordpress-admin-panels" target="_top">WordPress Admin Panels</a>

WordPress Admin Panels

WordPress Admin Panels WordPress Custom Post Types Custom post types are a new feature introduced in WordPress 3.0. It is a very powerful system because it allows you to easily introduce new post-like objects, without having to write much of its associated functionality. Menus, metaboxes, permalinks, and much more can be added just by registering...

<< Previous Next >>

<a href="http://shibashake.com/wordpress-theme/modify-custom-taxonomy-columns" target="_top">Modify Custom Taxonomy Columns</a>

Modify Custom Taxonomy Columns

WordPress custom taxonomies are useful for grouping wordpress posts and custom post types. For example, tags and categories are standard taxonomies provided by WordPress to group WordPress objects. By creating our own custom taxonomies, we can creating our own groupings of posts and custom post types. WordPress also provides a standard user interface...

<< Previous Next >>

<a href="http://shibashake.com/wordpress-theme/add-custom-taxonomy-tags-to-your-wordpress-permalinks" target="_top">Add Custom Taxonomy Tags to Your WordPress Permalinks</a>

Add Custom Taxonomy Tags to Your WordPress Permalinks

The WordPress custom taxonomy system allows you to create your own grouping of WordPress objects (e.g. posts, pages, and custom post types). Tags and categories, for example, are taxonomy objects that are native to the WordPress system. With the custom taxonomy framework, you can create your own tags and categories. In the article Custom Post Type...

<Playback Stop Play >

36 Comments

  1. Zak

    Hi,
    This has been really helpful for me since I am designing a site for a college newspaper which needs a lot more cms functionality and a lot less of the blog feel. I made two drop down menus within my article taxonomy for the section and the issue but it will only register one (the lower one on the screen). Is there any way to get both of them to work? I am also looking into having the issue selection be separate since I will most likely be posting all articles from the same issue at once and maybe having it at the top of the admin screen but I am guessing that I might have a similar problem. Any help would be greatly appreciated!

    4:22 am on August 9th, 2010 Reply
    • You can add as many drop-down menus as you want. Just make sure that the HTML names associated with each of them is different (line 12), and when you save the results, make sure you are getting the values from the right drop-down menu.

      <select name='my_unique_name_here' id='my_unique_name_here'>
      10:14 am on August 11th, 2010 Reply
      • Zak

        Well the problem that I am having isn’t making the boxes it is saving two separate boxes when I press the publish (or save draft) button to save the changes. With all of the other settings you normally don’t have to do them one at a time so I would think that there should be a way to do this. I tried switching the order of the buttons physically by moving the boxes and it only registers the lower down button. The part I am really having trouble with is that it doesn’t seem to be a problem with the code of a specific button since they both work separately and it is only when together that one doesn’t work. Also it didn’t seem to matter where on the page they were, only that one was above the other. Maybe I could combine them into the same box… Any thoughts?

        12:58 pm on August 16th, 2010 Reply
  2. D Barnes

    this is a beautiful tutorial. very useful. i am trying to add radio buttons though, rather than a drop-down list. i know you say: “If you are looking for a drop-down menu, or a radio button list, you are out of luck.” but on an introductory page you say, “Substitute the default tag interface with a drop-down menu, radio button list, or something else.” do you give directions on this anywhere? thank you.

    8:40 am on August 4th, 2010 Reply
    • You can do something like this for your styling function (from lines 8-28) -

      	// Get all theme taxonomy terms
      	$themes = get_terms('theme', 'hide_empty=0'); 
       
              $names = wp_get_object_terms($post->ID, 'theme'); 
              ?>
              <input type="radio" name='post_theme' value="" <?php if (!count($names)) echo "checked";?>> None<br>
              <?php
      	foreach ($themes as $theme) {
      		if (!is_wp_error($names) && !empty($names) && !strcmp($theme->slug, $names[0]->slug)) 
                              echo "<input type='radio' name='post_theme' value='{$theme->slug}' checked> {$theme->name}<br>\n";
      		else
                              echo "<input type='radio' name='post_theme' value='{$theme->slug}'> {$theme->name}<br>\n";
      	}

      Instead of echoing the HTML for a drop down list just echo the HTML for radio buttons.

      10:11 am on August 4th, 2010 Reply
  3. Nuwanda

    Thanks for this, Shiba. It answered a lot of questions.

    I’m designing a small real estate site and decided to used custom taxonomies for the property listing data: price, bedrooms, etc. Of course the standard taxonomy checkbox interface was useless as I need a variety of inputs. This article was a big help.

    But since I need a lot of meat boxes for my data inputs, I guess the best solution is to set up a master array containing the parameters for each meta box and then loop through a constructor function?

    Else I end up with a very long script.

    3:55 pm on July 29th, 2010 Reply
    • But since I need a lot of meat boxes for my data inputs, I guess the best solution is to set up a master array containing the parameters for each meta box and then loop through a constructor function?

      Yeah that makes a lot of sense. It is what I normally do in my plugins.

      8:15 pm on July 29th, 2010 Reply
  4. in part 2, your code on line #22, I had to change theme->name to theme->slug for use with a hierarchical taxonomy. Otherwise it kept creating new terms.

    2:27 pm on June 22nd, 2010 Reply
    • Thanks for the fix Adam. I have included it in the article above.

      7:40 am on June 23rd, 2010 Reply
  5. I’ll give that a go and see how I get on

    4:43 am on May 21st, 2010 Reply
  6. How would you add numbers to a drop down box so that they are sorted correctly and not as strings? eg 1,2,10,11,20 rather than 1,10,11,2,20

    2:16 pm on May 20th, 2010 Reply
    • One way to do this would be to create an array of taxonomy_id -> count, and then just run PHP asort on the array. Then you can loop through the elements in the sorted array to display them in your drop down box.

      3:07 pm on May 20th, 2010 Reply
  7. Angelia

    Me again. Okay, so, I thought I was in the clear with that solution, but, alas, no bueno again. Turns out that using the code for the custom dropdowns is doing something wonky with the post counts in the taxonomy. When I clear out all taxonomy terms etc., fire up this code in functions file and go to admin, all looks good, 0 posts for term, but, when I add a term to a post, save and then go to the taxonomy menu, it says that there are 2 posts under that term when there is only one. When I then delete the term, it says there is 1, when there is now 0. If I remove the custom styling/saving from functions file and repeat process using default meta box, the count is correct, 0,1,0. Any clues on this one?

    9:55 pm on February 8th, 2010 Reply
    • Thanks for uncovering this bug.

      The reason why count is incremented twice is because a taxonomy relationship gets saved for the post and another gets saved for the post revision.

      To fix this count problem, do a post_type check in your save_taxonomy_data function, e.g.

      	$post = get_post($post_id);
      	if (($post->post_type == 'post') || ($post->post_type == 'page')) { // OR $post->post_type != 'revision'
        		$theme = $_POST['post_theme'];
      		wp_set_object_terms( $post_id, $theme, 'theme' );
       	}

      I will update the article tomorrow. Now I am off to bed.

      1:35 am on February 9th, 2010 Reply
  8. Angelia

    I’m really struggling to figure out where to add in the show_option_none in this code so that there is an option to remove the taxonomy from a post if assigned in error. I see that it is available in the image example of your code, so, perhaps you could enlighten us?? Would be greatly appreciated. I believe your example here is the only one on the internet at present discussing how to customize the administrative inputs for custom taxonomies, so, thank you very much for that. I would love to see this elaborated on even more by those in the know. I’ve been wrecking my brain trying to work out how to provide multiple input options on a site I’m currently developing. I know things are about to change considerably in WP3.0, so, I want to be sure that the methods that I am using initially will be easily converted to take advantage of the new core functions once they are implemented.

    5:52 pm on February 7th, 2010 Reply
    • Hello Angelia,
      One way to do it is to add an additional “None” option to the drop down menu, [I have added it to the article above] e.g.

      ?>
      <option class='theme-option' value='' 
      <?php if (!count($names)) echo "selected";?>>None</option>
      <?php

      This will set the theme taxonomy value to NULL later on in the save_taxonomy_data function – i.e., it will remove the taxonomy term from the post.

      Let me know if you run into more problems.

      1:12 pm on February 8th, 2010 Reply
    • Angelia

      Thanks so much for the help Shibashake! I’ve just about been driving myself batty with all of this ;-) I have a client site that I’m building currently, and the main thing that they provide is lesson plans for teachers. My goal is to construct a backend admin that makes it easy for teachers to create the plans in the post editor ( taxonomy non-hierarchical modules ( dropdown ) for grade level, subject etc., custom taxonomy heirarchical for a gigantic ( dropdown ) listing of applicable state standards ), custom taxonomy default selection for general things like materials and the default post tags for other searchable descriptions … you get the point. Of course, then I have to have all of those same modules provide for in-depth searchability of the plans for the front end user. The new taxonomy, custom post types, and admin hooks are absolutely perfect for implementing all of this, but, my goodness, not only is there very little info out there at the moment, I’ve been watching the trac to see how things are coming along, and just about everything that I need to custom code to make this happen, is going to be implemented in 3.0. I’m pulling my hair out to work out how I should implement this stuff now, without having to redo everything in a month from now. I’ve scoured the available plugins ( simple taxonomies, custom taxonomies and gdtaxonomy tools ) in an attempt to put something custom together for my client to be able to use now, but, they all fall short in one way or another. Custom Taxonomies creates its own table, and I experienced some duplicate counts with it, not to mention there is a bug with not being able to deselect a selected term in the custom checkbox metabox. Simple taxonomies is really really simple, providing a nice start, but, doesn’t take into account hierarchical, or custom post type. I tried implementing them in there myself, but, no bueno. GD tools is mostly fluff, and the one feature that I was interested ( deletion ) doesn’t work. I checked the database twice, and the terms were still there. I’ve never written my own plugin from scratch, I mostly just do customizations of existing code ( self-taught … what can I say ), so I’m not really confident yet in my ability to put a beast like that together properly myself, especially after looking through the trac at all of the customizations that are having to be made on so many levels of core files just to implement these big changes.
      It seems that in the trac, they are extending Walker to deal with dropdowns for hierarchical terms.
      I’m rambling. My conclusion is to 1. remove any plugin attempts ( my custom ones or otherwise ) for now, 2. stick to the basics ( with your style inclusions ) 3. keep it all in the functions file and 4. hold off on implementing the hierarchical taxonomies until the 3.0 release. Then I’ll just hold my breath that along with the 3.0 release comes a taxonomy column in edit.php, singular and plural terms, easy styling of meta boxes, and the ability to transition what I’m doing in my functions file, to the core without screwing anything up in the database, ie unregister_taxonomy. Ha! Wish me luck. Should be fun explaining all of this to my client … always is.

      6:02 pm on February 8th, 2010 Reply
  9. Thanks Leo – that is very good advice. I have added it to the article :)

    7:29 pm on December 15th, 2009 Reply
    • Not at all. Also thank you for teaching me with the custom taxonomies. :)

      7:25 am on December 16th, 2009 Reply
  10. Hello, I got error with your_styling_function
    Says “Warning: strcmp() expects parameter 2 to be string”.

    I just copy and paste your code, nothing modified. :?:

    6:12 am on December 15th, 2009 Reply
    • Thanks for pointing that out Leo. The strcmp command should actually read -

      !strcmp($theme->name, $names[0]->name)
      

      There should be a ‘->name’ after $names[0]. Please let me know if you run into any more problems.

      1:01 pm on December 15th, 2009 Reply
      • Thank you for quick reply. It works!

        I think it’s better to use remove_meta_box to remove the original input taxonomy box, rather than register it to “shiba_post”. In this way the “Theme” tab will still appear in the admin menu, as a submenu under “Posts”, this lets other webmasters easily add more taxonomies.

        Thanks again.

        4:43 pm on December 15th, 2009 Reply
        • Sorry, I mean add more terms in that taxonomy, actually.

          4:44 pm on December 15th, 2009 Reply
  11. beautiful princess

    what an amazing site .Ilove it alot .
    with my hearty wishes
    bye

    8:43 am on December 14th, 2009 Reply
    • Glad you enjoyed it and thanks for dropping by :) Hope to see you again.

      3:04 pm on December 14th, 2009 Reply
  12. Hello Giraldi,

    Haven’t done anything like that myself … the best way to go would depend somewhat on the complexity of your hierarchy. If it is free-form like WP categories then it is probably easiest to look at the WP source and adapt the existing code to your own needs.

    The wp_dropdown_categories function is in the wp-includes/category-template.php file. I looked at it briefly, and it definitely looks adaptable.

    The function itself is not very large, and it only uses one core object – Walker_CategoryDropdown which can be found in wp-includes/classes.php.

    Instead of doing -

    $categories = get_categories( $r );

    Get you own list of taxonomy objects instead. Then you will also need to play around with the Walker_CategoryDropdown object in terms of what attributes you want to display.

    8:24 pm on November 8th, 2009 Reply
  13. Tx for the great tute, ShibaShake! Been looking for this.

    Just wondering, though.. Do you know how to create, with custom taxonomies, something similar to wp_dropdown_categories, that is, I need to have it show the post count and also be in a dropdown menu in the home page?

    Tx agian for the tute! Cheers!

    6:58 pm on November 8th, 2009 Reply
  14. Hi MacBoy,

    Glad you enjoyed the tutorial :)

    I am actually not affiliated with Justin. I do enjoy his articles, so I link to them when I write about related topics.

    8:40 am on October 24th, 2009 Reply
  15. MacBoy

    Hey there ShibaShake,

    This is an excellent tutorial. I’m glad that I’ve found a teammate of Justin Tadlock’s!

    ;-)

    You have a terrific talent in explaining things, keep it up!

    :-)

    8:12 pm on October 23rd, 2009 Reply
  16. Oh btw – also look into using child themes so that you can easily keep all your changes across theme updates.

    7:42 pm on October 18th, 2009 Reply
  17. pax

    I added the lines of code from the first 2 sub-chapters, to the default WP theme, and i got: “Warning: call_user_func(your_styling_function) [function.call-user-func]: First argument is expected to be a valid callback in /Library/WebServer/Documents/testwp5/wp-admin/includes/template.php on line 2936″

    screenshot here: http://img30.imageshack.us/img30/4889/shibaprintscreen.jpg

    1:59 pm on October 18th, 2009 Reply
    • Ok – it is because you did not yet define a “your_styling_function”.

      Just paste the your_styling_function example I gave above (the 3rd code snippet) into your functions.php file and the warning should go away.

      7:12 pm on October 18th, 2009 Reply
  18. To restyle the custom taxonomy input interface, you must use the add_meta_box command. – use it where?

    It goes in the functions.php file – best in a child theme area.

    the register_taxonomy line goes into your functions.php file as well. I just pasted that exact line in my functions.php, and it seemed to work fine, so I am not sure where your error is coming from.

    Could you post some of your surrounding code? Might help in seeing what the issue is.

    7:39 pm on October 11th, 2009 Reply
  19. pax

    This tutorial answered a lot of questions in using WP Custom Taxonomies – as the codex is very shy on documentation and examples.

    Problem I couldn’t use it.
    From the beginning: To restyle the custom taxonomy input interface, you must use the add_meta_box command. – use it where?

    Further on I get a Parse error: syntax error, unexpected ‘=’, expecting ‘)’ error, somewhere it seems because of this line

    register_taxonomy( 'theme', 'post', array( 'hierarchical' => false, 'label' => __('Theme'), 'query_var' => 'theme', 'rewrite' => array( 'slug' => 'theme' ) ) );
    5:42 pm on October 11th, 2009 Reply

RSS feed for comments on this post. TrackBack URL

Leave a Reply

search button search button
rss