0

我正在制作一个博客,它具有针对 img 的特定 html5 结构:

<figure>
<img />
<figcaption></figcaption>
</figure>

有没有办法自定义,the_content() 如何处理 img 渲染,专门为 img 添加我自己的模板(加上添加 the_post_thumbnail_caption() 模板)?

或者有没有办法为所见即所得制作自己的模板。我之所以问,是因为我想允许用户应用三种可能的 img 显示中的一种,这些显示绑定到特定类别的图形元素(例如)

提前致谢

4

1 回答 1

0

您可以使用 get_the_content() ,然后使用 preg_match 查找 img 标签并用您自己的代码替换,看看如何用 preg_match 替换 img 在这里https://stackoverflow.com/a/1107203/1287608

和这里的 get_the_content() 函数http://codex.wordpress.org/Function_Reference/get_the_content

于 2013-05-16T21:16:40.833 回答