<?php 
$postType = 'page';
$postStatus = 'publish';  
$leadTitle = 'Archived Tax Tips and News';
$new_post = array(
'post_title' => $leadTitle,
'post_status' => $postStatus,
'post_author' => '',
'post_type' => $postType,
'post_parent' => 58
);
global $wpdb;
$query = $wpdb->prepare('SELECT ID FROM ' . $wpdb->posts . ' WHERE post_title = %s AND post_type = %s',$leadTitle,$postType);
$wpdb->query( $query );
if ( $wpdb->num_rows == 0 ) {
    $post_id = wp_insert_post($new_post);
}   

add_action("template_redirect", 'archivetemplate');

    function archivetemplate() {
		
        global $wp;
        global $post;
		$plugindir = dirname( __FILE__ );
        if ($post->post_name == 'archived-tax-tips-and-news') {
            $templatefilename = 'newsarchive.php';
            if (file_exists(TEMPLATEPATH . '/' . $templatefilename)) {
                $return_template = TEMPLATEPATH . '/' . $templatefilename;
            } else {
                $return_template = $plugindir . '/template/' . $templatefilename;
            }
            do_theme_redirect($return_template);
        }
    }