Title: Plugin-development; inserting a static page
Last modified: August 18, 2016

---

# Plugin-development; inserting a static page

 *  Resolved [nutsmuggler](https://wordpress.org/support/users/nutsmuggler/)
 * (@nutsmuggler)
 * [20 years, 7 months ago](https://wordpress.org/support/topic/plugin-development-inserting-a-static-page/)
 * Hi.
    I am trying to build a plugin.I am trying to insert a static page programmatically
   when the plugin is installed. Here is the code:
 * function dbes_create_events_page()
    { global $wpdb; $sql= “INSERT INTO wp_posts(
   post-author,post_title) VALUES (‘admin’,’Eventi’)”; $wpdb->query($sql); }
 * As you see I just inserted two fields, for a test…
    This does not work, I just
   get error messages… WHat is the right way to implement this? Cheers, Davide

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

 *  [Denis de Bernardy](https://wordpress.org/support/users/denis-de-bernardy/)
 * (@denis-de-bernardy)
 * [20 years, 7 months ago](https://wordpress.org/support/topic/plugin-development-inserting-a-static-page/#post-277835)
 * $sql= “INSERT INTO $wpdb->posts (post-author,post_title)
    VALUES (1,’Eventi’)”;
 *  Thread Starter [nutsmuggler](https://wordpress.org/support/users/nutsmuggler/)
 * (@nutsmuggler)
 * [20 years, 7 months ago](https://wordpress.org/support/topic/plugin-development-inserting-a-static-page/#post-277867)
 * Thanks a million, issue solved 🙂
    Davide

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

The topic ‘Plugin-development; inserting a static page’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [nutsmuggler](https://wordpress.org/support/users/nutsmuggler/)
 * Last activity: [20 years, 7 months ago](https://wordpress.org/support/topic/plugin-development-inserting-a-static-page/#post-277867)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
