dqj29136 2013-05-16 20:55
浏览 71

Wordpress the_content() - 自定义img模板

I'm making a blog, that has specific html5 structure for img:

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

Is there a way to customize, how the_content() handles img rendering, adding my own template for img specificly (plus adding the_post_thumbnail_caption() template)?

Or is there a way to make your own template for WYSIWYG. I'm asking because i'd like to allow user, to apply one out of three possible img displays, that are bound to specific class of figure element (for example )

Thanks in advance

  • 写回答

1条回答 默认 最新

  • donglu2761 2013-05-16 21:16
    关注

    You could use get_the_content() and then use preg_match to look for the img tag and replace with your own code see how to replace img that with preg_match here https://stackoverflow.com/a/1107203/1287608

    and the get_the_content() function here http://codex.wordpress.org/Function_Reference/get_the_content

    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效