Reset custom taxonomy meta data after saving
First thing to check would be to make sure you have no spaces or invalid characters in your custom taxonomy names… This would cause them not to save properly. -shel
First thing to check would be to make sure you have no spaces or invalid characters in your custom taxonomy names… This would cause them not to save properly. -shel
Custom taxonomy return 404
Catchable fatal error: Object of class WP_Error
You can use taxonomy term meta for that. Like you said you have “team” and “player” taxonomy. Now you can add a taxonomy term meta on “player” taxonomy’s terms and save the “team” terms(where the “player” belong) ID on that “player” taxonomy term meta. Then get the the player based on that “team” taxonomy term … Read more
Well I found the answer. The code is correct. Wordpress do in taxonomy.php Line 3392 $count += (int) $wpdb->get_var( $wpdb->prepare( “SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status=”publish” AND post_type IN (‘” . implode(“‘, ‘”, $object_types ) . “‘) AND term_taxonomy_id = %d”, $term ) ); $count is empty because post_status=”publish” in … Read more
Thanks Milo, it was “has_term” that I needed. I found some VERY complex “answers” elsewhere that seemed to be addressing my situation, but am glad it was just a matter of using the right function. One thing that tripped me up for a while: has_term takes the specific term, THEN the taxonomy as arguments – … Read more
You can filter menu items with the wp_nav_menu hook
Here is your solution- add_filter( ‘wp_setup_nav_menu_item’,’the_dramatist_item_setup’ ); function the_dramatist_item_setup($item) { if (‘taxonomy’ === $item->type) { $posts = get_posts( array( ‘post_type’ => ‘post’, ‘numberposts’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘id’, ‘terms’ => $item->object_id, // Where term_id of Term 1 is “1”. ‘include_children’ => false ) ) ) ); $item->title = … Read more
Print Custom Taxonomy Term Name
Exporting Custom Taxonomy Description without Plugin