WordPress.org

Forums

[resolved] Looking for ideas/direction (7 posts)

  1. Doodlebee
    Member
    Posted 5 years ago #

    I was hoping someone could help me. I'm not looking for the "perfect soluion", but I'm stuck in a rut, and i think a second (or third, or fourth LOL) brain might be able to give me a fresh perspective.

    I've been looking for a theme (or code, or hack) for the last 2.5 years, and have been unsuccessful in finding what I need. I've managed to "hack" stuff myself, but what I've done has turned out to be cumbersome. I'm thinking I'll need to write my own plugin for what I need to pull off.

    The question, for me, however, is that what I've done is the rut I'm stuck in. I KNOW there's a better way to pull off what I need - so I was hoping if I asked you all about this, you might give me some ideas or direction in which way to go.

    Basically, I need to either create a theme, or some functions, or write a plugin that will do the following:

    1. Allow me to FULLY customize the order in which posts appear. I have 30 authors, and I need the posts they add to appear in order *by their position*. Not desc/asc or alphabetically or whatnot, but by a specific set of parameters that I designate.

    2. Use date-based archives BUT the month needs to run from the 19th to the 20th of the prior 2 months - not from the 1st to the 30th/31st. i.e. The "May 2010" archive link needs to pull posts from dates between March 20th, 2010 - April 19th, 2010.

    These are my two big requirements. The rest, I've been able to handle (like multiple authors on a post; and since the positions never change, but the people who *fill* them do making the old archives still show the old author's info) but I'm having a time pulling off the two items listed above.

    Does anyone know of any unusual WP functions that might pull this off? Or even some PHP stuff that you could point me to? I'd really appreciate any input/ideas you all might have on this.

    Thanks!

  2. MichaelH
    Member
    Posted 5 years ago #

    1. You could use wpdb and join wp_posts with your 'by their position' data.
    2. That's a bunch of gunk there ;) The wp_get_archives has a weekly argument that you might look at to see what's involved. But it's still a bunch of gunk...

  3. Doodlebee
    Member
    Posted 5 years ago #

    Thanks Michael. Yeah, it *does* seem like a bunch of gunk. WHich is why I'm thinking there has to be a better way to pull it off.

    Basically, it's for a newsletter. They put it out *before* the first of the current month (it actually gets sent out on the 20th of each month) which is why the offset is needed. Currently, I'm pulling it off by using tags - which is working, but it's still a nightmare. I keep thinking if I can just offset it to start the month on the 20th of 2 months prior, it would just automagically do it. Perhaps custom fields would be a better way to go.

    I'm also using the 3.0 Beta 2, so I'm thinking maybe one of the new functions (*maybe* custom post types?) provided might pull it off better as well.

    But thanks for the tip on #1 :) At the moment, I'm using userextra/usermeta for this, and it's also proving to be a mess because i have to change data in three different places to make it work. So I'll check that out and see what I can work with that.

    Thanks again! :)

  4. Doodlebee
    Member
    Posted 5 years ago #

    Actually, now that I think of it, custom post types just might be the way to go. I can set the "Archive" to just pull the most recent post from each author. That would even clear up a secondary issue I've been having (recurring posts)...but I'm wondering how the "Archives" would work for that. I'll have to investigate further :)

  5. MichaelH
    Member
    Posted 5 years ago #

    1. For the author sort, then I'd consider using wpdb on usermeta and get just that particular user meta field sorted by ID. Then do a foreach on those IDs and do a new WP_query for that particular authors posts.

    2. If you decided to use a custom field for your special archive then you could use scribu's http://wordpress.org/extend/plugins/custom-field-taxonomies/ and get a 'link' to a specific set of posts in that custom field.

    I'd don't know that you've a convincing case to use custom post_types--don't believe 3.0 will have a too useful way to access the posts in a specific post_type except via something like a Page where you code the page template to display posts in that particular post_type.

  6. Doodlebee
    Member
    Posted 5 years ago #

    Thanks again, Michael :) I'll give that plugin a shot too.

    And I see what you're saying about the post-types - so there's no "archive" of post types then? I'm not shy about writing plugins - so perhaps that's an idea that might be helpful....

    but anyway, you've given me some good starting points, and I really appreciate it :) Thanks!

  7. Doodlebee
    Member
    Posted 5 years ago #

    Just a quick update, in case anyone was wanting to accomplish the same thing. 3.0 gave some fun things to use to pull this off - but I also got some compromises form the group. So instead of archiving the newsletters via WordPress, what we're doing is archiving the newsletter *files* via WordPress. Every month, they do a "print preview" to save the online version as a PDF file,and that PDF is what gets emailed to the group, and printed for mail distribution. SO now we're going to upload a monthly archive of the PDF files, and if you want to see an old newsletter, you download the PDF (uploaded in the media library). I've done some other custom coding to make a gallery from the media library (these are all unattached files - so this gallery pulls directly from the media library) and sort them on order by descending date. it's working wonderfully. Now I don't have to worry about the weird date offset, and all is well :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.