• Joy

    (@joydeep-chatterjee)


    I was looking for help in a particular topic in WordPress in which I haven’t worked before. I’m unable to get how to work

    with cron-job and its settings.

    There are Three posts in WordPress, now these three posts are event posts which is showing event name, event day, event date and event time.

    I need to work only with “event date“. After doing a bit research stuffs I found that I need to setup a cron job in the three posts for updating the “event date” fields.

    In these three posts following are their respective datas from which I only need to work with “event date” which is the

    only section which is important for me at the present moment.

    Event 1 Name :- HEALING NIGHT Event 1 Date :- February 21, 2020 Event 1 Day :- Friday Event 1 Time :- 7:30 pm

    Event 2 Name :- SUNDAY CHURCH SERVICE Event 2 Date :- February 23, 2020 Event 2 Day :- Sunday Event 2 Time :- 10:00 am

    Event 2 Name :- PRAYING TOGETHER Event 2 Date :- February 25, 2020 Event 2 Day :- Tuesday Event 2 Time :- 7:30 pm

    Now for these three events there are 3 posts as I mentioned earlier. I am explaining by taking an event for example and then explaining all 3 events alongside.

    In the first event the “Event 1 Date” is “February 21, 2020“. I need to setup a cron-job (as per my thinking) for automatically updating the “Event 1 Date” as NEXT SEVENTH DAY just after 12:00 AM (midnight of February 21, 2020) i’e it AUTOMATICALLY GETS UPDATED to the “Event 1 Date :- February 28, 2020” and then automatically to “Event 1 Date :- March 6, 2020” and so on. This process will run with respect to all the three posts accordingly.

    Like for example for the second event the next “event date” will be “Event 2 Date :- March 1, 2020” and then “Event 2 Date :- March 8, 2020” and so on.

    Like for example for the third event the next “event date” will be “Event 2 Date :- March 3, 2020” and then “Event 3 Date :- March 10, 2020” and so on.

    All these dates and day will be with respect to Australian Standard time Zone.

    Any help is appreciated.

    • This topic was modified 5 years ago by Steven Stern (sterndata).
    • This topic was modified 5 years ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Joy

    (@joyously)

    I think some event plugins handle recurring events.

    At least the recurring ones need to be marked as recurring. Then when the post is saved/updated, the WP_cron is scheduled. See these schedule functions.

    Be aware that WP_cron is only triggered by a visit to your site. It will not run at the exact moment you schedule. For that, you need a real cron job on your server.

Viewing 1 replies (of 1 total)
  • The topic ‘Updating WordPress publish posts dates using cron-job’ is closed to new replies.