function moretag_custom($content) {
if (is_page() || is_single()) {
$content = preg_replace('/<p><span id="more-([0-9]+?)"><\/span>(.*?)<\/p>/i', "\n<div id=\"more-$1\" class=\"my_class\">\n[my_template]\n</div>\n$2", $content);
}
return $content;
}
add_action('the_content', moretag_custom, 100);
上記コードで[my_template]の部分に別に作成したテンプレートを挿入したいのですが、どの様にすればよいか分かりません
何か良い方法または参考になるようなものがあればお教え頂けると助かります