Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#17567 closed enhancement (maybelater)

Introduce default taxonomy template in Twenty Eleven.

Reported by: mfields Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2
Component: Bundled Theme Keywords: has-patch dev-feedback 2nd-opinion
Focuses: Cc:


I think that it might be a good idea to introduce a taxonomy.php template in Twenty Eleven which will display all public term archives. I've created one based on category.php.

Attachments (2)

17567-taxonomy-template.diff (1.8 KB) - added by mfields 5 years ago.
Introduce taxonomy template.
17567.diff (4.9 KB) - added by sorich87 4 years ago.
Add taxonomy support to archive.php

Download all attachments as: .zip

Change History (14)

5 years ago

Introduce taxonomy template.

#1 @iandstewart
5 years ago

I think an extra template might be a bit much. I imagine most Twenty Eleven users won't need it and if they are implementing public custom taxonomies should be able to add a template to a child theme.

#2 @mfields
5 years ago

I understand where you're coming from here, but feel that addition of this template is pretty important. It is possible that users have registered taxonomies via plugin. There are 4 that I have seen used for this purpose. I would assume that in these case, users choose the plugin route because they are not comfortable writing code.

I feel that it is important for the default theme to provide a default for any custom public object supported by WordPress. I realize that custom term views will fallback to archive.php, but think that it would be an awesome bonus if the actual term name, taxonomy name + optional description where available to users of Twenty Eleven.

#3 @iandstewart
4 years ago

After thinking about it some more I still think this feels out of scope for the default theme.

#4 @mfields
4 years ago

  • Keywords 2nd-opinion added

Right on. Would like to get a 2nd opinion on this one. FWIW many of the plugins I have created deal with display of custom taxonomies so I may be more sensitive to this than others. I would love to see the default theme provide a fallback for their display. Feel free to close this ticket if adding taxonomy.php is out of scope.

#5 @dd32
4 years ago

Personally, I think a default theme should be including a default taxonomy template, Something so generic that category.php shouldn't even be needed.

However; I'm not sure the translation handling would work for all languages, specifically "<taxonomy> Archives" is not going to work 100% for all languages and taxonomies, some taxonomies will probably want "All of our Cats" etc which makes a custom template for that taxonomy a better option. But for taxonomies added by plugins, having a basic support for them in the theme seems like a good idea to me.

(Just throwing my AU$0.02 out there)

#6 @iandstewart
4 years ago

My concern with a taxonomy.php template is that it's yet another template and would be used (guessing here of course) by very few people. I think a generic taxonomy template that handled cats, tags, and custom taxonommies would be really cool though. Patches welcome. :)

4 years ago

Add taxonomy support to archive.php

#7 @sorich87
4 years ago

This patch adds taxonomy support to archive.php

#8 @iandstewart
4 years ago

  • Milestone changed from Awaiting Review to 3.2

17567.diff works for me. Category, Tag, and Taxonomy templates can all override archive.php in a Child Theme. I like it.

#9 @iandstewart
4 years ago

  • Component changed from Themes to Bundled Theme

#10 @mfields
4 years ago

I can't seem to test patches at the moment but, by reading through the code, this looks good to me. I'm down with any method of getting the job done :)

#11 @dd32
4 years ago

The only thing I've got against 17567.diff is that some translators will no doubt mention the loss of the 'Category Archives' and 'Tag Archives' string, in some languages, '%s Archives' is probably going to be too generic and combined with taxonomy->singular_name might lead to strange results. I'd just use an if elseif else statement over the header strings there.

#12 @westi
4 years ago

  • Milestone 3.2 deleted
  • Resolution set to maybelater
  • Status changed from new to closed

The whole point of the template structure is that themes shouldn't need to have lots of conditional checking in template files but instead can provide different files for different scenarios.

17567.diff works against this and brings lots of lower level api calls up into the theme.

I can see more point in doing 17567-taxonomy-template.diff but I still don't think we need to do this for 3.2

Closing as maybelater

Note: See TracTickets for help on using tickets.