Snippets

cutiko Programatically set home and blog pages

Created by cutiko
1
2
3
4
5
6
7
8
<?php 
$home = get_page_by_title( 'Home' );
update_option( 'page_on_front', $home->ID );
update_option( 'show_on_front', 'page' );

$blog   = get_page_by_title( 'Blog' );
update_option( 'page_for_posts', $blog->ID );
?>

Comments (0)