Running a function using Crown WordPress on one day a week, for example, Mondays of every week
Running a function using Crown WordPress on one day a week, for example, Mondays of every week
Running a function using Crown WordPress on one day a week, for example, Mondays of every week
Cron job for wp_cron.php running but not publishing scheduled posts
Not sure if I’m understanding you correctly, but if you want to display a special of the day, depending on the day … I have a rough representation of how you could go about doing so. Example: $current_day = date(‘N’);// 1 (for Monday) through 7 (for Sunday) – daily/weekly //$current_day = date(‘j’);// 1 to 31 … Read more
Well it turns out that the reason has_post_thumbnail() was failing was because get_post_meta() was returning empty for scheduled posts. I’m still not sure why, but in case someone else has the issue, my workaround was to create a new function to fetch the featured image ID without relying on get_post_meta(): function get_featured_image_id($postID) { global $wpdb; … Read more
I’ve done it. Here is the post with answers on publishing a post marked as scheduled. Been running the code for 2 years on the site in question and it’s reliable. Marking future dated post as published
In short, you can make future posts visible by telling WordPress to mark them as ‘published’ instead of ‘scheduled’. You do this by using a future_post hook, which gets called when a post changes status. Each post type automatically gets its own future hook; since the custom post type I’m using is event, I can … Read more
Display “Today” Instead of Date for Pubslished Posts
WordPress is engineered exclusively to reside in web-accessible folders, unlike many less user-centric web frameworks, which separate locations of private (code, etc) and public (assets). Making filenames hard to guess is about as good as it gets with normal workflow. To have this really tight you would need completely custom workflow with files places into … Read more
you can count how many posts user can see like that: (int) ( ( time() – strtotime( get_userdata(get_current_user_id( ))->user_registered ) ) / ( 7 * 24 * 60 * 60 ) ) + 1; So you add filter for pre_get_posts to show user as many posts as compleate weeks he has spendt on your website. … Read more
First you can to create a schedule for one minute, then bind function with that hook. function add_new_intervals($schedules) { // add weekly and monthly intervals $schedules[‘every_single_minutes’] = array( ‘interval’ => 60, ‘display’ => __(‘Every Minute’) ); return $schedules; } add_filter( ‘cron_schedules’, ‘add_new_intervals’); // To schedule event for this minute event wp_schedule_event( current_time( ‘timestamp’ ), ‘every_single_minutes’, … Read more