Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So I have this code:

<?php wp_list_categories(array(
            'show_option_all'       => 'All Categories',
            'orderby'            => 'ID',
            'order'                 => 'DESC',
            'use_desc_for_title' => 0,
            'child_of'           => 0,
            'exclude'            => '',
            'exclude_tree'       => '', 
            'include'            => '',
            'hierarchical'       => 1,
            'title_li'           => NULL,
            'show_option_none'   => NULL,
            'number'             => NULL,
            'taxonomy'           => 'category' ));?>

And the first item, show_option_all, produces the following link:

<li><a href="http://mywebsite.com">All Categories</a></li>

That is, it is calling index.php or home.php when what I would like is for it to call the category.php template, where I would expect it to produce a link like this:

<li><a href="http://mywebsite.com/categories/all">All Categories</a></li>

Or something. Am I missing something?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Isaac, I guess this derived from the wp_dropdown_categories() function which is supposed to work like a filter on a page -- display posts from a certain category or display posts from all categories.

So wp_list_categories does the same but in a list of links instead of a dropdown menu, so it's still intended to filter posts by category, meaning "All categories" will link to posts from all the available categories, which is actually "removing the filter", thus pointing at your home page or blog page.

You can create a page template to display the posts in the fashion you like and link to that page manually, disabling show_option_all in your function call.

share|improve this answer
    
Thanks, I appreciate the informative answer. It still seems somewhat counterintuitive that this would point to home.php or index.php instead of category.php with a different query (what if index.php omits a certain category?). –  Isaac Lubow May 1 '11 at 4:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.