All tag/category/custom taxonomy archives 404
Well, I don’t think there’s a default page or template that lists all tags so you’d have to create one. Did you try creating a page with a “tags” slug and assigning it a template ?
Well, I don’t think there’s a default page or template that lists all tags so you’d have to create one. Did you try creating a page with a “tags” slug and assigning it a template ?
You’re checking if a product_type has a term using has_term(). Now you need to actually get the terms using get_terms(). That function can technically return from 1 to 4 terms. If more than one of the terms is set, you’ll need to pick one. In the following code, I chose the first since there’s guaranteed … Read more
Here’s how you do it… It’s quite extensive. I have no idea if this is the best way or not, – but this is how I solved it. There might be a couple of errors in the code. But it works for me. This is a quite specific wish for a functionality. Another way to … Read more
I really hope somebody can give you a much simpler answer, but this is pretty much all I can think of at the moment. If you’re okay with all the listings being on a single page you could do something like this: <?php // Get the slug of the page to use in our category … Read more
Great googly moogly, I figured this one out. $values = get_post_meta( get_the_ID(), ‘your_meta_whatever’, true ); foreach ($values as $value) {$term = get_term_by(‘term_id’, $value, ‘your taxonomy’); $name = $term->name echo $name;} If you want to keep ’em separated by commas or the characters your choice $values = get_post_meta( get_the_ID(), ‘your_meta_whatever’, true ); $total = count($values);$i=0; foreach … Read more
Got it! It seems this action is fired within a table element. Removing the _fields part seems to have done the trick as this refers to an action fired later in the page, after the table. $term_filter_name_edit = $type . ‘_edit_form’; add_action($term_filter_name_edit, ‘box_term’, 1000, 1 ); function box_term() { echo ‘Test output’; } Reference: https://github.com/WordPress/WordPress/blob/master/wp-admin/edit-tag-form.php
Try this to unregister the post_tag taxonomy from the Custom Post Type. function wpdocs_unregister_tags_for_posts() { unregister_taxonomy_for_object_type( ‘post_tag’, ‘post’ ); } add_action( ‘init’, ‘wpdocs_unregister_tags_for_posts’ ); Update the ‘post’ to your custom post type. Docs: https://developer.wordpress.org/reference/functions/unregister_taxonomy_for_object_type/ Also, you’ve defined the following twice in your $args ‘taxonomies’ => array(‘product’), ‘taxonomies’ => array(),
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
_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
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