Unable to create a new taxonomy

Use the conditional tag post_type_exists() to check if the post type book exists, if it exists add taxonomy to it otherwise not <?php if( post_type_exists( ‘book’ ){ add_action( ‘init’, ‘create_book_taxonomies’ ); // create two taxonomies, genres and writers for the post type “book” function create_book_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) … Read more

Unregistered taxonomy apears still as emtpy filter list

After I little digging I found the right action in the parent theme. The function looked like that (actually exactly the example I linked above): ////////////////////////////// // Add page category filter // ////////////////////////////// add_action(‘restrict_manage_posts’, ‘uncode_page_filter_post_type_by_taxonomy’); function uncode_page_filter_post_type_by_taxonomy() { global $typenow; $post_type=”page”; // change to your post type $taxonomy = ‘page_category’; // change to your taxonomy … Read more

echo a tax term in loop

I think you want to get the term link of the of each post. I will explain how you should get the answer for this. First you will need get the term object of current post. Support your taxonomy name is ‘your_taxonomy’; $terms = get_the_terms( $post_id, ‘your_taxonomy’ ); Because $term here is an array, in … Read more

Translation ready code format for taxonomy

_x( ‘Categories’, ‘taxonomy general name’ ) does it make taxonomy general name a text domain? wont it resulting in multiple translation? That taxonomy general name is the gettext or translation context used in the POT file. The text domain is the third parameter, which defaults to default. From the Codex: Sometimes a single term is … Read more

WordPress get parent category taxonomy

Sounds weird, but can you check if this code works: $terms = get_the_terms( $post->ID, ‘service’ ); if ( $terms ) { foreach ( $terms as $term ) { $colour_scheme = get_field( ‘colour_scheme’, $term ); $svg_image = get_field( ‘svg_image’, $term ); // we check if the term is top-level term, in which case it does not … Read more