PluginProbe
SpiceBox / 0.6
SpiceBox v0.6
trunk 0.2.2 0.2.3 0.2.4 0.2.5 0.2.6 0.2.7 0.2.8 0.2.9 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 0.3.8 0.3.9.1 0.3.9.2 0.4 0.5 0.6 0.7 1.0 All 76 releases
spicebox / inc / spicepress / default-pages / blog-page.php

blog-page.php in SpiceBox 0.6, at inc/spicepress/default-pages/blog-page.php

23 lines 634 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $post = array(
3 'comment_status' => 'closed',
4 'ping_status' => 'closed' ,
5 'post_author' => 1,
6 'post_date' => date('Y-m-d H:i:s'),
7 'post_name' => 'Blog',
8 'post_status' => 'publish' ,
9 'post_title' => 'Blog',
10 'post_type' => 'page',
11 );
12 //insert page and save the id
13 $newvalue = wp_insert_post( $post, false );
14 if ( $newvalue && ! is_wp_error( $newvalue ) ){
15 update_post_meta( $newvalue, '_wp_page_template', 'page.php' );
16
17 // Use a static front page
18 $page = get_page_by_title('Blog');
19 update_option( 'show_on_front', 'page' );
20 update_option( 'page_for_posts', $page->ID );
21
22 }
23 ?>