タイトルのまんま。
ちまちまと編集画面がとても大変なので、functions.phpにこんなの作った。
あとは編集画面に[include_static_html]と書いて静的HTMLをアップするだけ。
<?php /** * @brief ページ制作に楽なショートコード * @param * @retval */ function include_static_html_func($attr) { extract(shortcode_atts(array( 'path' => "", ), $attr)); if (is_page()) { $page = get_post(get_the_ID()); if (!$path){ if ($page->post_parent){ $path = sprintf('%s/%s', get_page_uri($page->post_parent), $page->post_name); } else { $path = $page->post_name; } } $path = sprintf('%s/static_html/%s.html', get_template_directory(), $path); if (file_exists($path)){ // return @file_get_contents($path); ob_start(); include $path; return ob_get_clean(); } return $path . " not exists."; } return "invalid include_static_html_func"; } add_shortcode('include_static_html', 'include_static_html_func');
追記
PHPが効くようにincludeにした。