Custom Post Types and Categories?

It appears that although register_post_type() will add the new post_type immediately, it seems as though you need to bind up the logic into a function, and add it to the init action for the categories taxonomy to be associated with the post_type. A working example follows: function add_articles_post_type() { register_post_type(“article”, array( ‘label’ => ‘Article’, ‘public’ … Read more

Taxonomies, restrict editing and creation of terms?

When you registered the taxonomy with register_taxonomy there is a capabilities argument. This takes, an array of the capabilities for this taxonomy. In particular: ‘manage_terms’ ‘edit_terms’ ‘delete_terms’ ‘assign_terms’ Associated with each of them should be a capability that it is required to be able to perform that action. For instance to assign_terms usually requires the … Read more

Exclude specific taxonomy term when using wp_get_post_terms

I’d use wp_list_filter() with the operator ‘NOT’ to compare either the term’s name, slug or ID (depending how you want to test for term to be exluded). Untested but something like this should work (assuming that you want to exclude the term with slug ‘myslug’): $terms = wp_get_post_terms( $post->ID, ‘wedding_cat’); $terms = wp_list_filter($terms, array(‘slug’=>’myslug’),’NOT’); (Of … Read more

WordPress built-in method to extract array of term IDs?

I know you’ve long since solved this, but wanted to offer another solution. This question popped up as “related” when I was answering another one. You can use the WordPress function wp_list_pluck to return an array with values as one of the fields of the array or objects sent to the function. In other words, … Read more

Removing the “Popular Terms” area from the Taxonomy Edit Screen in the Admin Area

Oh, I love it when you give me an easy one. Starts to make up for all those harder ones… (well, partly. 😉 So what you want is to replace this: (source: mikeschinkel.com) With this: (source: mikeschinkel.com) How? Use the ‘wp_tag_cloud’ hook which you can put into your theme’s functions.php file or in a .php … Read more

Custom Taxonomy leads to 404 page

You can add flush_rewrite_rules() after registering your custom taxonomy. NOTE: Flush rules only on activation or deactivation, or when you know that the rewrite rules need to be changed. Don’t do it on any hook that will triggered on a routine basis. More detail information in the comments on WP Engineer’s post: Custom Post Type … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)