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'm creating a network that has profile pages for authors (custom post type) on the main site, where I've created a few non-hierarchical taxonomies to help users sort through the authors.

These taxonomies are: title, genre, publisher and date published. I understand the first three.

What I don't understand is how to appropriately keep track of date published. Should I use a taxonomy? But that presents certain problems (I think) when it comes to searching a range of dates, lets say between 1900-1917. Or if I wanted to create a tag cloud.

I've always felt that taxonomies were to establish relationships between terms. Does a range qualify as a relationship, and more practically can it work?

If I created a custom field for date, how would I have users search through results?

Hope that makes sense. Just looking for some opinions, from more experienced people, on how that would be best represented.

share|improve this question
1  
I'd say don't go for either of these! On your front end, where you'd be asking the users to search through the posts, keep a drop down with values as '24 hours old', '7 days old' etc. or any ranges you want (like between specific years). When a user selects and submits a value out of these, search for posts published within that range. A custom field / taxonomy wouldn't be ideal for date published as WP already has a unique date field for custom posts. –  Rutwick Gangurde Oct 8 '11 at 6:26
    
Thanks Rutwick for your input. Points me in the right direction. –  jw60660 Oct 8 '11 at 14:37
add comment

1 Answer

I'm not sure why an Author post-type has a "title" taxonomy, unless you meant books or something, or even why you can't use the built-in published date field, but here goes:

Store the date published as a timestamp in a custom field. You can do the conversions behind the scenes and just show users the actual dates. And then filter by meta value when retrieving the posts. You can learn more about how exactly to do this over at the codex: http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

share|improve this answer
    
Thanks very much; I can see how my question was a bit confusing. Yes, title meant book titles, and the published date was of the book(s), not the post. I wanted to include this with each of the authors so a search for a date range would result in authors who published book during that period. –  jw60660 Oct 8 '11 at 17:59
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.