This thread is resolved. Here is a description of the problem and solution.
Problem:
I create a simple ads site. The custom taxonomy is a simple hierarchy: Ad category > Subcategory. The user can select only one category or subcategory. I need to have several conditionals:
- if it's a subcategory, show button back to parent.
- if it's a category with subcategories show a button which opens a div with a list from a child view with the subcategories (this was simple but I need this button only in this case). Here's a link to this case: https://produsinbihor.imagomedia.ro/categorie-anunt/legume-zoldsegek/
- if it's a category without subcategories show nothing.
I create a simple ads site. The custom taxonomy is a simple hierarchy: Ad category > Subcategory. The user can select only one category or subcategory.
In the category archive I should show a button to the parent term of the selected taxonomy term if it's a subcategory.
Is there a way to achieve this because $parent is only for post parents?
Unfortunately the shortcode doesn't output anything.
And I have to complicate it further...
I need to have several conditionals:
- if it's a subcategory, show button back to parent
- if it's a category with subcategories show a button which opens a div with a list from a child view with the subcategories (this was simple but I need this button only in this case). Here's a link to this case: hidden link
- if it's a category without subcategories show nothing: I tried several tips from the support forums to check if the child view has items or not but they are not working.
I am not sure why the shortcode doesn't output anything at your end. However I further tested the code today that I have provided and I found out that this code is not going to work 100% when we have multiple parent and child terms, so we can skip that.
If you want to apply several conditions like you have mentioned in last reply, I am afraid you cannot achieve it using built-in toolset features.
But if you want to give it a try with custom solution then please note this requires a custom code or modifications which falls into Custom coding & custom development and it is out of support policy (https://toolset.com/toolset-support-policy/). So we recommend to contact Toolset recommended service providers to further discuss the custom approach. We have some recommended list of service providers here if you would like to take a look: https://toolset.com/contractors/
-- This may help with the custom code approach: hidden link
But I still need that parent link so please help me to solve why that shortcode is not working. It simply outputs nothing. Maybe you could take a look at my admin.