Current category link filter
In my theme I have an archive template for a taxonomy (taxonomy-cat_projet.php). In this template I have a list of this taxonomies' links to allow users to select a taxonomy. Here is the code I'm using to list the categories links:
ul
?php $args = array(
'title_li' = '',
'taxonomy' = 'cat_projet',
'hide_empty' = false,
);
wp_list_categories( $args ); ?
/ul
Is there a way (once a category is selected) it's link could change so that if it's clicked it lists posts from all categories. Like, first click makes that category active, and the second time it's clicked it becomes inactive.
I know I could do it in javascript, but i prefer doing it in php, like using some "current taxonomy link" filter if it exists.
Topic link-category taxonomy filters custom-taxonomy theme-development Wordpress
Category Web