サクサク読めて、アプリ限定の機能も多数!
“add_filter( 'post_thumbnail_html', 'custom_attribute' );function custom_attribute( $html ){ $myclass = 'myclass'; // クラス名 return preg_replace('/class=".*\w+"/', 'class="'. $myclass .'"', $html);}”
webstrategist のブックマーク 2015/03/21 20:07
[WordPress] アイキャッチで出力される img タグ中のサイズやクラスを変更したり削除したりする“add_filter( 'post_thumbnail_html', 'custom_attribute' );function custom_attribute( $html ){ $myclass = 'myclass'; // クラス名 return preg_replace('/class=".*\w+"/', 'class="'. $myclass .'"', $html);}”2015/03/21 20:07
“add_filter( 'post_thumbnail_html', 'custom_attribute' );function custom_attribute( $html ){ $myclass = 'myclass'; // クラス名 return preg_replace('/class=".*\w+"/', 'class="'. $myclass .'"', $html);}”
このブックマークにはスターがありません。 最初のスターをつけてみよう!
memocarilog.info2014/11/24
<?php the_post_thumbnail(); ?>タグでアイキャッチ画像を表示すると以下のような形で img タグがHTMLに出力されます。 この img タグ内の width/height 指定やクラス名を任意のものへ変更したり、削除する方法の...
22 人がブックマーク・3 件のコメント
\ コメントが サクサク読める アプリです /
“add_filter( 'post_thumbnail_html', 'custom_attribute' );function custom_attribute( $html ){ $myclass = 'myclass'; // クラス名 return preg_replace('/class=".*\w+"/', 'class="'. $myclass .'"', $html);}”
webstrategist のブックマーク 2015/03/21 20:07
このブックマークにはスターがありません。
最初のスターをつけてみよう!
[WordPress] アイキャッチで出力される img タグ中のサイズやクラスを変更したり削除したりする
memocarilog.info2014/11/24
<?php the_post_thumbnail(); ?>タグでアイキャッチ画像を表示すると以下のような形で img タグがHTMLに出力されます。 この img タグ内の width/height 指定やクラス名を任意のものへ変更したり、削除する方法の...
22 人がブックマーク・3 件のコメント
\ コメントが サクサク読める アプリです /