Skip to content

Adding a new default page to wordpress mu blogs

I would like that every time I create a new wordpress blog on my WPMU system, it has a second default page. I managed to fix the issue with the about page, to change it to something else I want instead of the “dumb” about text, and its working properly, but now I would like to add a “contact” page, with a contact form on it.

For this the first thing I tried to do is to put the contact form plugin into the mu plugins folder. Unfortunately it doesn’t work, it has some settings and because the settings are not where the plugin searches for it, I would need to change to much for the plugin to work. I skiped this step, and I told myself, that I will activate the plugin, its easier to activate a plugin, and have a working page with the form, than activating the plugin, adding the page and adding the code to the page to display the contact form too.

To make this work, I need to add the following code to wpmu-functions.php:

// Second page

	->insert( ->posts, array(

		\'post_author\' => ,

		\'post_date\' => ,

		\'post_date_gmt\' => ,

		\'post_content\' => __(\'Content of new page.\'),

		\'post_excerpt\' => \'\',

		\'post_title\' => __(\'Second Page\'),

		\'post_name\' => __(\'second-page\'),

		\'post_modified\' => ,

		\'post_modified_gmt\' => ,

		\'post_status\' => \'publish\',

		\'post_type\' => \'page\',

		\'to_ping\' => \'\',

		\'pinged\' => \'\',

		\'post_content_filtered\' => \'\'

	) );

This is the “hard coded” way, and as I continued reading on wpmu support pages, they have found some other solutions too. Here is a link for more solutions on this topic. Somebody actually made a plugin for it, and there is a suggestion to use New Blog Defaults plugin with the blog templates addition.

I tried this too, but somehow it was not what I was looking for, personally I didn’t really liked this solution, but the idea is good. It was just to much workaround for me with this one.

Click here for the best hotel deals - HotelsCombined.com

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*