show_option_all array setting for taxonomy filter

Viewed 88

I have the following code that displays a list of custom taxonomies (sectors) for the custom post type of case_studies.

<?php
    $customPostTaxonomies = get_object_taxonomies('case_studies');

    if(count($customPostTaxonomies) > 0)
    {
         foreach($customPostTaxonomies as $tax)
         {
             $args = array(
                  'orderby' => 'name',
                  'show_option_all'     => 'View All',
                  'show_count' => 0,
                  'pad_counts' => 0,
                  'hierarchical' => 1,
                  'taxonomy' => $tax,
                  'title_li' => ''
                );

             wp_list_categories( $args );
         }
    }
?>

This is great, I can use this as a filter for the user to browse the different case study sectors.

I would, like a button that says View All at the top of the sector list so the user can click to return to the main case study archive page and see them all.

I'm having trouble with this line:

'show_option_all'     => 'View All',

This seems to work the way I expect when I use this whole thing for a standard blog archive page and blog categories (it returns the user back to the blog archive)

But in my case above, it adds the link and still returns the user to the blog archive instead of the case study archive...

Are there any further lines that I can add to direct this View All link to the correct archive page? I can't even thing where to start looking or what to start searching for... Thanks as always for looking!

0 Answers
Related