kaji0245回答ポイント 100ptウォッチ

wp-touchのサムネイル画像の修正をしたく以下のサイトを参考に修正中です。

http://knk-n.com/2011/06/27/wptouch-top/

しかしながら、以下の行でシンタックスエラーになります。
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];

コピー分は以下のブロックです。
function catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];

if(empty($first_img)){ //Defines a default image
$first_img = "http://knk-n.com/Default.jpg";
}
return $first_img;
}

※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。
ログインして回答する

みんなの回答

この質問へのコメント

コメントはありません

この質問への反応(ブックマークコメント)

質問の情報

登録日時
2013-01-21 20:18:28
終了日時
2013-01-28 20:20:03
回答条件
1人5回まで

この質問のカテゴリ

この質問に含まれるキーワード

シンタックス24WP217SRC250

人気の質問

メニュー

PC版