The MU forums have moved to WordPress.org

the_loop used for time (4 posts)

  1. TheQuicksilver
    Member
    Posted 16 years ago #

    We are looking to use WPMU as a newsletter tool. That said, is there a way to get the_loop() to just display all the posts from the last day posts were made? We plan on having a (bi-)weekly release schedule, but each item in the newsletter will be its own post, so my thinking was to just identify the last day posts were made, and display everything from that day. Can the_loop() do that, or am I barking up the wrong tree?

  2. peiqinglong
    Member
    Posted 16 years ago #

    You have to do a custom mysql query that first gets the server current date/time and then checks to see if the posts made are the same date/time and to display, and if not, no display.

  3. dsader
    Member
    Posted 16 years ago #

    query_posts looks like the loop template tag you need. Time Parameters Retrieve posts belonging to a certain time period. Example day=15; shows all posts made, for example on the 15th.

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

  4. TheQuicksilver
    Member
    Posted 16 years ago #

    Okay, so, it looks like I could run a query, grab the date for the latest post with the_date(), and use that as a variable value within query_posts(), something like
    query_posts("day=$newsletter");, right?

    Now, the question is, how to use the_date() to get the most recent posting's date, without posting it. Maybe run The Loop to display just the most recent, then run a second The Loop to display the result set of query_posts() based on the date of the first post, excluding its id. That sounds like it works in my head anyway...what do you think?

About this Topic

  • Started 16 years ago by TheQuicksilver
  • Latest reply from TheQuicksilver