• Hi,

    I have a site, which day have sort of “the sentence of the day”, which means that every day there is an inspiring text for that date.
    They use that by using the scheduled posts feature in the posts admin panel, and they enter the post every month and assign a date for each post to be published.
    These sentences should be cycled in a yearly basis, which means that every date on the year will have the same sentence.
    So, when scheduling a post to Nov-01,2009, it will be published on that date, but what will they do after one year? should they re-assign all 365 posts again to new dates of the next year?

    Will be happy for some ideas how to deal with this issue.
    Thanls

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    Maybe this Old Post Promoter plugin would do the trick.

    Otherwise, you might be able to create a custom query to display posts in the “sentence of the day” category that are exactly one year old.

    Good luck!

    Thread Starter maorb

    (@maorb)

    Thanks @mtw28, I’ll check the plugin.

    About the other idea, could you give me some guideline about how building and using such a query?
    If building one, I’ll prefer to build a query that will show a post that has the same month and same day on the month, and not posts that are exactly one year old. In such a query I’ll be able to display the posts also when they will be 2,3, etc.. years old.

    No problem. Here’s an example of getting posts that are the same month and same day of the month for category 1 as the current month and day.

    <?php
    $today = getdate();
    $myposts = get_posts(monthnum=' .$today['mon'] .'&day='.$today['mday'].'&cat=1' );
    ?>

    You would use this in your theme template, such as sidebar.php, in a loop like this:

    <ul>
    <?php
    $today = getdate();
    $myposts = get_posts('monthnum=' .$today['mon'].'&day='.$today['mday'].'&cat=1');
    	foreach($myposts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>

    Also, here’s some more info on using get_posts().
    Hope that helps!

    Thread Starter maorb

    (@maorb)

    @mtw28 – thanks for the code, I’ll check it soon and report how it went.
    The “Old Post Promoter plugin” is not useful, since it only picks the old posts randomly, and I need them to be at the exact dates…

    Asking the plugin developer for the possibility to change it and add such a feature, I also thought to pay him for that job, but the buster said that “he will do it for 1000$”. Well, let him kiss my a*s ….

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Scheduled posts, after a year…’ is closed to new replies.