Displaying the Taxonomy and a Queried Term on a taxonomy.php page?
Try to get the value of querystring $country = $_GET[‘country’];
Try to get the value of querystring $country = $_GET[‘country’];
Some passing by can eventually find an answer to this question here. Same community but more proactive there. Weird.
echo term_description( $term->term_id, $taxonomy );
There isn’t a concept of a post mapping to a single taxonomy, so this won’t work out. Taxonomies are things like colour and size with terms such as lilac, azure, maroon, small, medium and large. So your question is a bit like asking to be able to display “colour” when on a post, whereas the … Read more
If you want to get all the descendents for the volume category and its ID is lets say 5: $categories = get_categories( array( ‘child_of’ => 5 )); foreach($categories as $category) { echo ‘<p>Category: <a href=”‘ . get_category_link( $category->term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $category->name ) . ‘” … Read more
How to prevent multiple custom terms from being created
Try relying on the new WP_Term_Query() class, here’s an example per your code: // WP_Term_Query arguments $args = array( ‘taxonomy’ => ‘carabana_Cat’, ‘hide_empty’ => false, ‘orderby’ => ‘description’, ‘child_of’ => 28) ); // The Term Query $term_query = new WP_Term_Query( $args );
Display all Custom taxonomy terms and their relevant custom posts
Thank you for all the comments! With your help I managed to rule out a standard WordPress issue. I couldn’t find the culprit (As @DaveRomsey suggested, it could be one of the get_terms or get_terms_orderby hooks altering results). In any case, I solved it by sorting the array: $searchedterms = get_terms( ‘category’, array( ‘name__like’ => … Read more
If you want to achieve that, then you need to add creation_date for each taxonomy, hooked with ‘create_category’ (or create_YOURTAXONOMYNAME) function. lets say,for example, you add a new category : add_action( “create_category”, ‘my_func123’, 10, 2 ); function my_func123( $term_id, $tt_id){ update_option(‘my_taxnm_date_’.$term_id, time()); } then later, anytime, you will be able to get the creation date … Read more