functions.phpでmoreリンク先の空要素に任意のテンプレートを挿入したい
-
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]の部分に別に作成したテンプレートを挿入したいのですが、どの様にすればよいか分かりません
何か良い方法または参考になるようなものがあればお教え頂けると助かります
4件の返信を表示中 - 1 - 4件目 (全4件中)
4件の返信を表示中 - 1 - 4件目 (全4件中)
- トピック「functions.phpでmoreリンク先の空要素に任意のテンプレートを挿入したい」には新たに返信することはできません。