Create Page/Post Programmatically In WordPress

As a WordPress theme developer, this article is very useful: Programmatically Create a Post in WordPress

I take the code out and put here for reference:

The various calls to this function would look like this:

 

Leave a Reply