Title: Creating Post Programatically Not Showing On Front End
Last modified: January 19, 2023

---

# Creating Post Programatically Not Showing On Front End

 *  Resolved [wponboard](https://wordpress.org/support/users/wponboard/)
 * (@wponboard)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/creating-post-programatically-not-showing-on-front-end/)
 * When I attempt to add an event programatically to the month view of the calendar
   and initially load the calendar/month page, it gets added in the backend but 
   doesn’t show in the frontend. When I refresh the page, it finally shows the event.
   I used this code
 *     ```wp-block-code
       $args     = [
       		'start_date' => '2023-01-19 10:00:00',
       		'end_date'   => '2023-01-19 12:00:00',
       		'title'      => 'Event Test',
   
       		'meta_input' => [ ],
       	];
       $event    = tribe_events()->set_args( $args )->create();
       wp_publish_post($event);
       ```
   
 * from this post [https://wordpress.org/support/topic/wp_insert_post-dont-show-event-in-calendar/](https://wordpress.org/support/topic/wp_insert_post-dont-show-event-in-calendar/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [WilloftheD](https://wordpress.org/support/users/abzlevelup/)
 * (@abzlevelup)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/creating-post-programatically-not-showing-on-front-end/#post-16404842)
 * Hi [@wponboard](https://wordpress.org/support/users/wponboard/), yikes! Let’s
   see. Could you try following this function reference here for creating Events?
   [https://docs.theeventscalendar.com/reference/functions/tribe_create_event/](https://docs.theeventscalendar.com/reference/functions/tribe_create_event/)
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/creating-post-programatically-not-showing-on-front-end/#post-16453409)
 * Hi [@wponboard](https://wordpress.org/support/users/wponboard/)
 * We haven’t heard from you in a while, so I’m going to mark this as resolved. 
   Feel free to start a new thread if you have any more questions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Creating Post Programatically Not Showing On Front End’ is closed to 
new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Darian](https://wordpress.org/support/users/d0153/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/creating-post-programatically-not-showing-on-front-end/#post-16453409)
 * Status: resolved