开发者

Wordpress hook for <!--more--> tag

I want to insert a v开发者_如何转开发ideo right before where the <!--more--> tag has been placed on single post page, and the posts index.

Is there a hook to add code before or after the author's <!--more--> tag in a post?

Thanks!


You can try a filter:

function more_filter($content) {
    return str_replace('<!--more-->', 'video code <!--more-->', $content);

}
add_filter('the_content', 'more_filter', 1, 1);

Adjust the priority so the filter runs before the <!--more--> tag is removed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜