サクサク読めて、アプリ限定の機能も多数!
Code 1 2 3 4 5 6 7 <?php function remove_p_on_images($content){ //画像のみpタグで囲わない return preg_replace('/<p>(\s*)(<img .* \/>)(\s*)<\/p>/iU', '\2', $content); } add_filter('the_content', 'remove_p_on_images'); ?> view raw gistfile1.php This Gist brought to
OfficeRiverHead のブックマーク 2013/02/28 13:56
画像のみ、pタグで囲わないようにする - かちびと.net[Must][あとでみる] Code 1 2 3 4 5 6 7 &lt;?php function remove_p_on_images($content){ //画像のみpタグで囲わない return preg_replace('/&lt;p&gt;(\s*)(&lt;img .* \/&gt;)(\s*)&lt;\/p&gt;/iU', '\2', $content); } add_filter('the_content', 'remove_p_on_images'); ?&gt; view raw gistfile1.php This Gist brought to 2013/02/28 13:56
Code 1 2 3 4 5 6 7 &lt;?php function remove_p_on_images($content){ //画像のみpタグで囲わない return preg_replace('/&lt;p&gt;(\s*)(&lt;img .* \/&gt;)(\s*)&lt;\/p&gt;/iU', '\2', $content); } add_filter('the_content', 'remove_p_on_images'); ?&gt; view raw gistfile1.php This Gist brought to
このブックマークにはスターがありません。 最初のスターをつけてみよう!
kachibito.net2013/02/28
Kachibito.net is a website to writing tutorials and code snippets for Web Developers, the main subjects are WordPress, javascript, CSS, OSS, tools and resources. Links About/Privacy Policy Contact ...
36 人がブックマーク・7 件のコメント
\ コメントが サクサク読める アプリです /
Code 1 2 3 4 5 6 7 <?php function remove_p_on_images($content){ //画像のみpタグで囲わない return preg_replace('/<p>(\s*)(<img .* \/>)(\s*)<\/p>/iU', '\2', $content); } add_filter('the_content', 'remove_p_on_images'); ?> view raw gistfile1.php This Gist brought to
このブックマークにはスターがありません。
最初のスターをつけてみよう!
画像のみ、pタグで囲わないようにする - かちびと.net
Kachibito.net is a website to writing tutorials and code snippets for Web Developers, the main subjects are WordPress, javascript, CSS, OSS, tools and resources. Links About/Privacy Policy Contact ...
36 人がブックマーク・7 件のコメント
\ コメントが サクサク読める アプリです /