views:

55

answers:

1

I am attempting to have lots of posts in a specific category. The post will have a custom field that will be a date. I need the posts to be organized by the category, the custom field, and each page of posts should be separated by month of the custom field. So hard to explain...

Page of posts for the current month. Links at the bottom for Previous and Next month. Sorted by custom field, not post date. And it should only be in the specific category.

Any ideas on what I can do to achieve this?

A: 

There are several things you can do. If you want to sort it by date, you could just modify the published date in the right sidebar of the Add Post screen.

If you want posts to be only from a certain category you can create a custom query like this

query_posts('category_name=My Category');

And then order by your custom field using: orderby=meta_value

So the full query is:

query_posts('category_name=My Category&orderby=meta_value&meta_key=dateField')

Hopefully that helps you get on the right track.

Documentation:

http://codex.wordpress.org/Function_Reference/get_post_meta

http://codex.wordpress.org/Function_Reference/query_posts

jkeesh
I at one point made a really long reply to this thread and I guess it never went through. The issue with changing the publish date is that wordpress then "schedules" the post. I need future posts to show up as well. So, it has to be done in a custom field. I can query the custom field, I can make sure that it is in a custom post type, and all of that works. It is displaying all posts from this month forward in a specific post type. Now the issue that remains is I don't want to show 10 per page, I want to show however many posts there are per month. And each page of posts would be a month name.
LostInQuery