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.

I need to show all my custom articles on an archive page but grouped/sorted by subject.

So that the result is somewhat like

Subject A:

  • A Sample Post
  • Another Sample Post

Subject B:

  • List item

A Post About Bacon

and so on?

I've read some related posts on here 17155 and 14306 and have come to the conclusion that this type of grouping must be done with post meta. However a simple metabox with a text input isn't as friendly as the checkboxes of the category metabox.... nor the tag box with its (choose from most popular tags option).

So I am looking for advice, what is the best way to get the best of both worlds? I'd like to enforce selection into only 1 subject, but I'd like to be able to see what other subjects have already been used.

Can I replace the category metabox so that it uses radio buttons instead of checkboxes and then save the category info as post meta on save? where to start?

share|improve this question
    
Should the list be extendable by the user? You might need a datalist for this. –  toscho Jul 11 '12 at 15:52
    
i'd like the user to be able add a term. i think i am going to pursue this route: wp.tutsplus.com/tutorials/creative-coding/… am trying to wrap it into a full-fledged plugin at the moment. –  helgatheviking Jul 11 '12 at 19:20
    
i made a pretty good start on making that a plugin: github.com/helgatheviking/Radio-Buttons-for-Taxonomies i'm sure it needs some testing before i can add it to the repo. i like the idea of datalists though! more to learn i guess. –  helgatheviking Jul 11 '12 at 21:30
    
Would it not be preferable to add an additional taxonomy? And then add the taxonomy to the post type(s) –  Barry Carlyon Jul 15 '12 at 17:24
    
@BarryCarlyon - i ended up doing that. the trouble is you can't sort a query by taxonomy. –  helgatheviking Jul 16 '12 at 2:07
add comment

1 Answer

up vote 0 down vote accepted

i ended up building a plugin that enforces radio buttons for any taxonomy.
http://wordpress.org/extend/plugins/radio-buttons-for-taxonomies/

for the project in question i will probably also save the taxonomy as meta. sucks that i need/want half the ability of taxonomy (knowing other available terms, etc), but need the sorting by meta.

share|improve this answer
    
The other option would be to create the taxonomy without a public UI and then build your own meta box for it. –  Barry Carlyon Jul 16 '12 at 10:42
    
the plugin removes the normal metabox and replaces it w/ my custom one. –  helgatheviking Jul 16 '12 at 19:34
    
Lovely. (I didn't follow the link to go look at the code :-P ) –  Barry Carlyon Jul 16 '12 at 21:36
add comment

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.