Articles of custom taxonomy

How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?

I have a custom hierarchical taxonomy containing only two levels of items. First Level the title, second level items of the taxonomy. Is it possible to add a “meta box” to the posts editor of WordPress, so all elements in the second level are shown as checkboxes, first level as title and the author can […]

Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue

I registered a non-hierarchical custom taxonomy (‘property_features’). There is a checkbox for every terms of this tax in a custom meta box on the edit-screen. All terms are displayed and all terms wich are attached to the post are checked correctly. So far so good… … but when I check one of the unchecked boxes […]

Custom Taxonomy conditionals

So I have setup a custom post type ‘products’ and custom taxonomies / categories ‘defence’ ‘law & enforcement’ and ‘Commercial’. I have using the following conditional to set some specific css and the correct banner for a product: <?php if (has_term( ‘defence’, ‘productcat’, $post->ID )) { ?> This works fantastic if the product is in […]

How to create custom taxonomy URLs without taxonomy name?

I have a website that lists businesses in different cities (this is a niche site, so all businesses have the same “classification”). For starters I created a CPT for locations and a taxonomy called “Cities,” which 150 or so cities as terms. All 300+ locations have been tagged with a city. I was able to […]

Move terms from one taxonomy to another keeping the hierarchy

I am creating a custom taxonomy for the first time. I am trying to add a Location taxonomy. What I am actually trying to do is use existing categories to make them into locations. I went into the database table wp_term_taxonomy and manually changed the taxonomy column of the ones I wanted from category to […]

How do I list custom taxonomy terms without the links?

I’ve searched far and wide to try and find an answer to my question. I’m hoping I can get help here. Here goes… I’m currently retrieving the terms of my custom taxonomy using: <?php echo get_the_term_list( $post->ID, ‘skills’, ‘<ul><li>’, ‘</li><li>’, ‘</li></ul>’ ); ?> What I’m trying to do is retrieve these same post-specific custom taxonomy […]

Custom Posts Hierarchy? (State/City/Restaurant)

Question: What is the best way to create a hierarchy structure (also called parent/child relationships) between custom post types? For example, we currently have 3 post types: States, Cities, and Restaurants. Each Restaurant will be in a city, and each city will of course be in a state. So for example, Joe’s Crab Shack would […]

Storing an array using update_metadata

Have a custom taxonomy “guest” with extra fields. foreach ($extra_fields as $field => $display) { ?> <tr class=”form-field”> <th scope=”row” valign=”top”><label for=”<?php echo $field;?>”><?php echo $display;?></label></th> <td><input type=”text” name=”<?php echo $field;?>” id=”<?php echo $field;?>” /></td> </tr> <?php } There are 10 extra fields per taxonomy. Can I / should I save these as an array […]

How to sync tags between posts that are linked through Posts 2 Posts?

I am faced with a thorny problem and can’t seem to find the solution in the wealth of community knowledge on the web. I have two custom posts types “Person” and “Activities”. I use posts 2 posts (plugin) to link Persons with their various Activities and vice-versa. I have Taxonomies which apply to Activities. They […]

Display Terms for all posts in Current Archive or Query

I am using the following code to create a list of linked terms belonging to a taxonomy. <?php $taxonomy = ‘taxonomy_name’; $queried_term = get_query_var($taxonomy); $terms = get_terms($taxonomy, ‘slug=’.$queried_term); if ($terms) { echo ‘<ul>’; foreach($terms as $term) { echo ‘<li><a href=”‘.get_term_link($term->slug, $taxonomy).'”>’.$term->name.'</a></li>’; } echo ‘</ul>’; } ?> Is there a way that I can modify this […]