Jump to content

WordPress default pages


xtrafile

Recommended Posts

In wp-admin/include/upgrade.php, I know you can add default pages to be added into the MySQL database when the script is installed.

 

The default page:

 

	$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '', '".$wpdb->escape(__('About'))."', '0', '".$wpdb->escape(__('about'))."', '$now', '$now_gmt', 'publish', 'page', '', '', '')");

 

I want to add a second default page, such as this:

 

	
$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging.'))."', '', '".$wpdb->escape(__('Welcome'))."', '0', '".$wpdb->escape(__('welcome'))."', '$now', '$now_gmt', 'publish', 'page', '', '', '')");

 

However, this second default page code is incorrect since only the first code above gets inserted during installation.

 

If you have experience with WP that's great!

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/95775-wordpress-default-pages/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.