テンプレートの作成は簡単です。新しいページ my-template.php を作成し、このコードを一番上に置きます。
<?php
/*
Template Name: My New Template
*/
?>
しかし、それはあなたのテーマに依存します。私はあなたのために20を編集しました。テンプレートを作成するためのアイデアが得られます。
<?php
/*
Template Name: My New Template
*/
get_header();
$headers[] = 'From: Me Myself <me@example.net>';
$headers[] = 'Cc: Aravind B Codex <abc@wordpress.org>';
$headers[] = 'Cc: iluvwp@wordpress.org'; // note you can just use a simple email address
?>
<?php
if(is_page()) :
wp_mail( $to, $subject, $message, $headers );
endif;
?>
<div id="container">
<div id="content" role="main">
<?php
/* Run the loop to output the page.
* If you want to overload this in a child theme then include a file
* called loop-page.php and that will be used instead.
*/
get_template_part( 'loop', 'page' );
?>
</div><!-- #content -->
</div><!-- #container -->
メールコードを入れてください。テンプレートディレクトリに保存します。
管理パネルに移動し、ページを追加/編集します。ページの右側にオプション (テンプレート) があります。テンプレートがドロップダウンに表示されます。テンプレートを選択してページを保存する