Custom taxonomy
-
My guess is that I could figure out the answer to this if I learned the innards of custom taxonomies, but I think this is a small detail that you will want to address, so I am posting here first.
The issue: on some pages, the name of the FAQ Category custom-taxonomy will appear, but on other pages it will not appear.
Website: https://www.hunterthinks.com
Example link that shows name
Example that does not show nameI use different functions to retrieve the category name, and it seems to me that because I am doing that, I am messing up your code. The following is from my header.php
<h2 id="section_name"> <?php if ( is_single() ) { global $post; $categories = get_the_category($post->ID); echo '<a href="'.get_category_link($categories[0]->term_id ).'">'.$categories[0]->cat_name.'</a>'; } elseif ( is_archive() ) { single_cat_title( '', true ); } else { bloginfo('description'); } ?></h2>
My knowledge of WordPress functions is intermediate, at best. My guess is that you wrote code to connect the FAQ custom taxonomy to the single_cat_title() function, but did not think someone would do what I did and go directly at get_the_category() for custom post types. Or, I am completely wrong. ??
On my to-do list, this is pretty low, and because this is my first custom post type and my first custom taxonomy, the learning curve is steep, so I am not in a hurry.
Thanks for any help you can offer.
- The topic ‘Custom taxonomy’ is closed to new replies.