Skip Navigation

[Resolved] create custom navigation for custom taxonomies

This support ticket is created 8 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Luo Yang 8 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#372573

hi,
I am trying to create a navigation through a custom taxonomy tree, just like the navigation through a woocommerce products' catalogue.

i need to move through the different taxonomy terms, showing only the child taxonomy terms (if present), or the custom post types of that single taxonomy term, if this term is the last internal one, something like:

custom_taxonomy_name
root_term_1 -> show only child taxonomy terms in page body
child_term_1 -> show only child taxonomy terms in page body
child_term_2 -> show only child taxonomy terms in page body
last_level_term_1 -> show all associated posts in page body
last_level_term_2 -> show all associated posts in page body
child_term_3 -> show only child taxonomy terms in page body
root_term_2 -> show only child taxonomy terms in page body

to give an example:

on product cat i have name, description, image, subcategories and associated products (i DON'T want to show HERE any product, only children taxonomies): hidden link
on last product category level i show the posts associated to this level: hidden link

thx,
stefano castelli

#372802

Dear stefano,

I think it is possible within nested views, for example:
1) Create a view list root level terms, filter with:
Select taxonomy terms whose parent is None.
and display below view (step 2)

2) Create a view to list sub level terms, filter with:
Select taxonomy terms whose parent is the value set by the parent view.
in section "Loop Output"
a) if there are results, in shortcode <wpv-loop>..</wpv-loop>
display this view itself (step 2)
b) if there isn't any results, in shortcode [wpv-no-items-found]...[/wpv-no-items-found]
display below view (step 3)

3) Create a view to list posts, filter with:
Select posts with taxonomy:
Categories set by the parent View
and display posts as what you want

#373782
Schermata 2016-03-08 alle 12.58.27.png

hi luoy,
thx for your answer, but i cannot accomplish what i need that way: maybe iìm doing something wrong but i don't know what.

but i created a view to extract my root terms in my custom "collections" taxonomy: you can see it working in

hidden link

and here we have a correct inline-block OL extracting terms title and a custom term image i added through types.

i need that when i click on a single term (let's use "bauhaus", since it's the only one to have posts associated to) i need to have a 2 options behaviour:
1) if the current term has sub-terms associated to (children terms) i need to print another (identical to the root level one) inline-block OL with the sub-terms present only INSIDE of the current term;
2) if the current term has NO sub-terms, i need to print the list of all single posts (2 custom post types called "accessories" and "products") associated to it;

i tried to create this by generating a custom "collections" taxonomy archive, but it seems to simply not being used when i navigate through the levels i'm expecting to be parts of the archive: in the archive output loop (see screenshot) i have post url/title/featured image, but this structure is not what i find in the real archive page output.

i know i'm doing something wrong, but i cannot identify which one is... can you help me with that?

#373784

ps: i tried to create as exactly as i understood your instructions, but the nested view with root, second and posts levels it's simply not working.

#374172

Thanks for the details, in your case there are three levels of terms: top-> sub-> third, then posts
it needs 4 views, see the demo site:
hidden link
user/pass: xgren/111111

1) view list root level terms
hidden link
filter with:
Select taxonomy terms whose parent is None.
and display view of step 2)

2) view to list sub level terms
hidden link
filter with:
Select taxonomy terms whose parent is the value set by the parent view.
and display view of step 3)

3) view list third level terms
hidden link
filter with:
Select taxonomy terms whose parent is the value set by the parent view.
and display view of step 4)

4) view to list posts
filter with:
Select posts with taxonomy:
collections set by the parent View
and display posts.

Hope it help

#374379

Hi,
thx now i see what's my problem!

i don't have the need to show all CPT in a single nested view, but i need to navigate them through the single levels, in different pages.

so: i need to have only the first level of taxonomy in my starting page, and then i need to modify the archive taxonomy pages (Archive for: Hardware), in order to see inside them first the children taxonomy terms, and then, if children taxonomy terms are not present, i need to show the final CPT's associated with the current term:

STEP 1): starting wp page, with only the first-level taxonomy terms: see hidden link
STEP 2): clic on one of the terms (use "cabinet HW") and move to its archive page:
hidden link
STEP 3): HERE on the archive page i get the display of all its:
STEP 3A): sub-level taxonomy terms (if they exist: the current term has children terms) - i assume this will be in [wpv-items-found], or
STEP 3B): we're in the last level taxonomy terms - i assume this will be in [wpv-no-items-found], and i get the list of all CPTs with the current taxonomy term associated to.

sorry about my lack of precision in describing my needs, but i have understood only now how to explain it to you 🙁

thx,
stefano

#374404
Schermata 2016-03-09 alle 17.26.49.png
Schermata 2016-03-09 alle 17.27.04.png

update: i tried to set up a custom "Hardware" taxonomy archive page, following the instructions contained in https://toolset.com/documentation/user-guides/normal-vs-archive-views/

i created a WP archive for taxonomy "Hardware" and i created the loop and the output (see attached screenshots), and it's partially working, see:

hidden link

i get a good output structure, but i need to print in page only the current taxonomy terms, not all the ones involved, see the page itself for context explanation.

thx,
s.

#374506

Are we talking about the the two links "Cabinet HW, Cabinet knobs" in problem page URL
hidden link

Are you going to display only the parent term "Cabinet HW"?
How do you setup the links?
Are you using Views shortcode [wpv-post-taxonomy] to display them?
I did not see the shortcode for render them in your screenshot:
hidden link

In the term archive page, you can display the current term information by using Views shortcode [wpv-archive-title]
https://toolset.com/documentation/views-shortcodes/#wpv-archive-title
This shortcode displays the title of the WordPress archive page.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.