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.

How can I make a list of categories with 4 last posts in each where every category is sorted by meta_value.

For example, template without sorting by meta_value is http://pastebin.com/AeH6vx9b It displays parent categories only.

Few days I am searching something related to categories extra fields but can't find something workable.

This is my best search result. What I have to do with this? I don't understand it. Is it possible to do what I want?

share|improve this question
add comment

1 Answer

This is no solution, just an explanation: WordPress currently doesn't have taxonomy meta data. You could add a stand alone table to add meta data there. Anyway, it's not recommended to add your taxonomy/category/tag meta data to the options table as this one wasn't made to get JOINed to do meta queries by it. My personal recommendation would be that you simply add another taxonomy that has your meta value and as well link this one. This would allow you to do default a tax_query by two taxonomies and their terms.

share|improve this answer
    
Kaiser thank you, it's a good recomendation. But I don't know how to make another taxonomy with meta. I know how to add another taxonomy, but it wouldn't have meta fields. And the same, I don't know how to link categories with custom taxonomy. Can you help me, please. Any example will be greate –  okonik Mar 8 '13 at 9:47
    
@okonik You A) ain't got meta data for any taxonomy (or category or post tag). Period. That's a fact that you will have to life with. B) Create an additional taxonomy and when you add Term A / Taxonomy A, then just add meta to it, with adding Term B, C, X / Taxonomy B. And those terms are your taxonomy meta data. It is kind of a "manual" handling for taxonomies, but it is (for queries and other WP internals) the best thing you can do. –  kaiser Mar 8 '13 at 12:05
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.