bytesmasher
Forum Replies Created
-
I’m not using hidden taxonomy terms… I’m using custom post types. The issue arose because the post type has tags enabled, but there were no tags on the posts in question. I’d like the option to hot display tags in my breadcrumbs at all, as I’m going to be adding quite a lot of tags to my posts.
Updated post_terms function for breadcrumb_navxt_class.php for anyone else who’s having this issue:
function post_terms($id, $taxonomy) { /* How about instead of doing this here, we check first to see if there's tags, mmmkay? //Add new breadcrumb to the trail $this->trail[] = new bcn_breadcrumb(); //Figure out where we placed the crumb, make a nice pointer to it $bcn_breadcrumb = &$this->trail[count($this->trail) - 1]; */ //Fills a temporary object with the terms for the post $bcn_object = get_the_terms($id, $taxonomy); //Only process if we have tags if(is_array($bcn_object)) { // Start Edit //Add new breadcrumb to the trail $this->trail[] = new bcn_breadcrumb(); //Figure out where we placed the crumb, make a nice pointer to it $bcn_breadcrumb = &$this->trail[count($this->trail) - 1]; // End edit $is_first = true; //Loop through all of the term results foreach($bcn_object as $term) { //Run through a filter for good measure $term->name = apply_filters("get_$taxonomy", $term->name); //Everything but the first term needs a comma separator if($is_first == false) { $bcn_breadcrumb->set_title($bcn_breadcrumb->get_title() . ', '); } //This is a bit hackish, but it compiles the term anchor and appends it to the current breadcrumb title $bcn_breadcrumb->set_title($bcn_breadcrumb->get_title() . str_replace( array('%title%', '%link%', '%htitle%', '%type%'), array($term->name, get_term_link($term, $taxonomy), $term->name, $term->taxonomy), $this->opt['H' . $term->taxonomy . '_template'])); $is_first = false; } } else { //If there are no tags, then we set the title to "Untagged" .... wait, why not just *not* display the crumb? WTF? // $bcn_breadcrumb->set_title(__('Un' . $taxonomy, 'breadcrumb_navxt')); } }The project I’m working on is a fairly daunting proprietary CMS -> WordPress migration, and your plugin has saved me many hours of attempting to get Taxonomies and Custom Post Types to jive nicely. You’ve helped save what little sanity I have left at the moment 😉
Works great! This is quickly becoming my favourite plugin. In fact, I dare say it should be core functionality 😉
Awesome! Thanks for the prompt response 🙂