Convert number to date format within an array
Convert number to date format within an array
Convert number to date format within an array
Problem with my loops
Hope this code may be help you <?php /* * Add columns to event post list */ function add_acf_columns ( $columns ) { return array_merge ( $columns, array ( ‘event_date’ => __ ( ‘Event Date’ ), )); } add_filter ( ‘manage_events_posts_columns’, ‘add_acf_columns’ ); /* * Add columns to event event list */ function events_custom_column ( … Read more
Option 1 (no code): you can manually edit each post and change the published date. Look in the “Publish” box where you publish or update posts, and there will be a “published on” date with an “edit” link. Option 2 (requires database access): you can run a MySQL query to adjust all posts’ dates. UPDATE … Read more
Yes, I think it should be possible to add and remove nav menu items programmatically. You can use either wp_nav_menu_objects or wp_nav_menu_items filter to edit a nav menu. Or if you can edit the menu walker, you could add the event items inside it. With the first filter you could use wp_update_nav_menu_item to create and … Read more
The correct way is to use WordPress Cron and schedule your event. Also you should consider adding real cron job as outlined here for better precision. 1.) I modified your draft_the_post function to support parameter. So now we can specify which post and also i updated the portion that checking the time. 2.) dg_cron_schedule_delete_posts will … Read more
With debugging enabled, you should have gotten the following message: Notice: A non well formed numeric value encountered This is because strtotime() expects an integer as its second argument. You could use it like so $date = date(‘Y-m-d’, strtotime(‘+1 week’, strtotime($lejar_datum))); or if you want to use the more modern approach with DateTime $dt = … Read more
This is the part that is responsible for random date: //* Generate a random date between January 1st, 2015 and now $random_date = mt_rand( strtotime( ‘1 January 2015’ ), time() ); So you need to change it. And if you want to randomize only the time part, then this is one way to achieve that: … Read more
Comparing two dates (ACF and current time)
WordPress Admin – Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat