<?php
echo esc_html( $title ); ?></h1>
<form method="post" action="options.php">
<?php
settings_fields( 'reading'
);
if ( !
in_array( get_option( 'blog_charset'
), array
( 'utf8', 'utf-8', 'UTF8', 'UTF-8'
), true
) ) { add_settings_field( 'blog_charset',
__( 'Encoding for pages and feeds'
), 'options_reading_blog_charset', 'reading', 'default', array
( 'label_for' => 'blog_charset'
) );
}?>
<?php
if ( !
get_pages() ) : ?>
<input name="show_on_front" type="hidden" value="posts" />
<table class="form-table" role="presentation">
<?php
if ( 'posts' !==
get_option( 'show_on_front'
) ) :
update_option( 'show_on_front', 'posts'
);
endif;
else :
if ( 'page' ===
get_option( 'show_on_front'
) && !
get_option( 'page_on_front'
) && !
get_option( 'page_for_posts'
) ) { update_option( 'show_on_front', 'posts'
);
}