クッキーは表示する前に実行しないといけません。
なので、WordPressでは、アクションフックget_headerを使うといいらしいです。
add_action( 'get_header', 'my_get_header');
function my_get_header() {
if ($_POST('action')=='order'){
$limitTime = time()+60*60*24*30;
setcookie('name' , 'Nanashi Gonbe' , $limitTime);
}
}
参考になったサイトさん
http://designhack.slashlab.net/php-note-for-setting-cookie-in-wordpress/