I am trying to: only display the lowest Child taxonomy in Visual Editor cell.
I have a taxonomy "sports", with various levels (Teamsport - Basketball - 3x3). Some posts will have as lowest level "teamsport", others will delve deeper. Only the lowest level needs to be displayed (with URL)
I'm trying to figure out how to only display the term which has no child (the lowest applicable term).
Hello. Thank you for contacting the Toolset support.
As understand your query that you want to display terms having no child but which terms you want to display?
- All taxonomy terms which has not the child?
I have a CPT "Sports Providers", linked with a taxonomy "sports" (among others).
Each Sports Provider offers one or more sports.
As an example, there is "All Sports"> Team Sports > Basketball or All Sports>Water Sports>Diving.
In each post, I only want to display Basketball and Diving (the lowest level). A provider can offer many sports. hidden link
On the link (above), under Activities, there is the taxonomy displayed. Currently, I have only ticked off the lowest level (Basketball or Diving) so it appears with the hyperlink but I would need to have the parents selected as well but not displayed on the Template for Sports Provider.
The reason I want the parents to be selected as well is that the parents would need to be selectable in a search based on taxonomy.
To display the childless taxonomy terms you need to write custom shortcode. You should use the get_terms() function and to get childless taxonomy terms you can use attribute "childless".