• Hi everyone,

    I’m writing a science fiction blog set 10 years into the future.
    I basically need all posts to display as if they are 10 years from now.

    Eg. It posts needs to display as:
    February 7, 2021 instead of
    February 7, 2011

    And next year need it to display as 2022 instead of 2012 etc.

    This will be for every post that I write.
    How can I automatically add 10 years to every post date?

    I realise it’s a bit of an odd request, but it’s necessary for this particular project. I know it’s possible – Just not sure how.

    PS. I’m familiar with the ‘No Future Posts’ plugin, https://www.ads-software.com/extend/plugins/no-future-posts/ which allows you to date posts in the future and have them display as that future date but it means that I then can’t schedule posts, and I still would like to be able to schedule posts aswell.

    I hope someone out there can help. It would be very much appreciated.

    many thanks in advance
    Luke

Viewing 2 replies - 1 through 2 (of 2 total)
  • Use a custom field and call function:

    <?php $date="futuredate"; echo get_post_meta($post->ID, $date, true); ?>

    For each post, create a custom field of “futuredate” and then write in the date that you want it to be. Replace all instances of any date grabbing code with the above code.

    (Taken from this thread.)

    Thread Starter lnuto

    (@lnuto)

    Thanks boyevul.

    Is there any way I could make it automatic, so I didn’t need to write in the new date in the custom field for each post?

    The post dates will always be exactly 10 years ahead of the current real date. So, is there any way I could just add something like “+10” to the “year” function so it just adds 10 years on?

    thanks in advance
    Luke

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to display post dates as 10 years into the future? ie. posting from 2021…’ is closed to new replies.