Articles of taxonomy

Match and Merge Terms in Different Taxonomies

I have some author names held in two different taxonomies where the terms are formatted in two different but overlapping ways. There are about 400 terms in each taxonomy, associated with roughly 700 posts. (The reason for all this mess is a complicated migration from an old version of Expression Engine.) The first taxonomy is […]

Register `product_cat` taxonomy for default post post type

Is it possible to register WooCommerc’s product_cat taxonomy for use by posts? I have tried the following with no success. function custom_cross_content_type_taxonomies(){ register_taxonomy_for_object_type( ‘product_cat’, ‘post’ ); } add_action( ‘init’, ‘custom_cross_content_type_taxonomies’, 0); I will be writing posts about each of the product categories and it would be nice to group with the same terms without duplicating […]

Dropdown taxonomy lists in admin menu

I’ve added 4 taxonomy list to my wordpress backend: BH Job Experience BH Job Types BH Job Regions BH Job Tags These taxonomy lists are added under Job Listings like this: Now I would like to have these 4 taxonomy lists under a dropdown with name BullHorn. Something like this: But I can’t really find […]

How to “group” (categorize) the Pages together?

I have a lot of Pages which can be (need to be) grouped under a number of different Categories. ** Then the more important thing is, i need to control those pages (of different groups) programatically via functions.php. Lets say, i would have: Page A (Categorized as: Fruits) Page B (Categorized as: Vehicles) Page C […]

Change categories count to include media attachments

I am creating a gallery that will automatically display new images from a chosen category and its subcategories. I have set up the categories so that they will apply to media using: register_taxonomy_for_object_type( ‘category’, ‘attachment’ ); Now I need to make it so that categories will count the related attachments not just posts. I found […]

Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()

I’m developing a plugin and I’ve problem with inserting new term to my custom taxonomy. <?php add_action(‘init’, ‘create_tax’, 0); function create_tax() { $args = array(…); register_taxonomy(‘custom_tax’, array(‘post’), $args); } // I need this function, so I can use it anywhere in my theme & plugin. function add_new_term($name) { $result = wp_insert_term($name, ‘custom_tax’, array(‘parent’=>0) ); var_dump($result); […]

Admin: Navigation Menus do not show empty categories/taxonomies in the list's search tab

This is referring to the Admin area of Navigation menus It seems the normal behavior for building out Navigation Menus (Appearance>menus) is that when you expose categories or custom taxonomies, that list only shows terms that are not empty. This is fine behavior, but becomes a pain when trying to build out complex menus when […]

Custom Taxonomy Terms in Menu lead to which page?

Hello All I was wondering if someone could help me out. I have created a custom post type along with a custom taxonomy. In this custom taxonomy I have created custom terms through the wp dashboard. I have added these terms to my Nav menu when I click on these terms in goes to a […]

Running a custom query inside another cpt single and trying to grab a variable

I made a cpt “Neighborhoods” for different neighborhoods. On the Neighborhoods archive, you click on one and go to the single. All good. an example url is /blog/neighborhoods/south-austin/ But I’m trying to run a wp_query on that single looking for all properties in that are in that neighborhood. I created a custom taxonomy called “prop_neighborhood” […]

Get most recent post for every term in a given taxonomy type

I’m looking for an efficient way to retrieve the most recent post from every term for a given taxonomy type. I found this question, which provides the same solution I came to on my own: $terms = get_terms( ‘my_taxonomy’ ); foreach( $terms as $term) { $args = array( ‘posts_per_page’ => 1, ‘post_type’ => ‘any’, ‘my_taxonomy’ […]