Filter custom taxonomy table
Filter custom taxonomy table
Filter custom taxonomy table
How to position taxonomy meta box on page
Yes and no. Ofcourse you can do it, but that doesn’t mean it’s a great way to do it, or the fastest or easiest way. You could give every barber shop its own term that has a price, but then you gain a whole host of new problems. Instead, lets retreat to the fundamentals and … Read more
Use printf with an img tag and wp_get_attachment_image_src <?php $term_id = get_queried_object()->term_id; $tax_image = get_term_meta( $term_id, ‘custom_taxonomy_image’, true ); $image_id = wp_get_attachment_image_src( $tax_image, ‘full’ ); if ( $image_id ) { printf( ‘<div class=”icon”><img src=$s /></div>’, $image_id ); } ?>
Your code is not listing the terms from post A, it is listing all the terms on your site. You can test this by creating a post Z and adding new terms to Z, you will see those new terms listed on all posts, even post A. The reason is this: $terms = get_terms($taxonomy); get_terms … Read more
Try select t.name, t.slug, tm.meta_key, tm.meta_value from wp_term_taxonomy AS tt inner join wp_terms AS t ON tt.term_id = t.term_id inner join wp_termmeta AS tm ON t.term_id = tm.term_id where tt.taxonomy = ‘census-tract’ order by t.name
If those extra fields are saved on Edit User page you should get them with get_user_meta function: $social_twitter_handle = get_user_meta( $curauth->ID, ‘firm_social_twitter_handle’, true ); If those extra fields are attached to each term you can use get_term_meta function: $firm_terms = wp_get_object_terms( $curauth->ID, ‘firm’ ); if ( ! empty( $firm_terms ) ) { if ( ! … Read more
So that tag cloud seems to be a regular tag cloud generated by an AJAX request. This box appears to be the only place a tagcloud is generated via AJAX, so we can use that knowledge to use the get_terms filter to filter any term queries performed in that AJAX request. function wpse_277075_filter_tag_cloud( $terms, $taxonomies, … Read more
get_object_taxonomies() by default returns a list of taxonomy names like category and post_tag. If you want the function to return taxonomy objects instead, then set the second parameter to objects: $taxonomies = get_object_taxonomies($custom_post_type_name, ‘objects’); And then change your foreach () code to foreach ($taxonomies as $taxonomy => $tax_object), then use $tax_object->labels->singular_name to access the singular … Read more
I ended up adding an additional taxonomy meta class I was then able to use the following to get my phone number: <?php //Get the correct taxonomy ID by slug $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); //Get Taxonomy Meta $saved_data = get_tax_meta($term->term_id,’loc_phone’); ?> <?php if( $saved_data != “” ) { … Read more