{"id":7075,"date":"2012-05-15T01:52:10","date_gmt":"2012-05-14T16:52:10","guid":{"rendered":"http:\/\/fukata.org\/?p=7075"},"modified":"2017-08-11T23:00:55","modified_gmt":"2017-08-11T23:00:55","slug":"php-adjust-image-size-wordpress-theme-tanzaku","status":"publish","type":"post","link":"https:\/\/blog.fukata.org\/archives\/7075\/","title":{"rendered":"WordPress\u30c6\u30fc\u30de\u300ctanzaku\u300d\u306e\u753b\u50cf\u30b5\u30a4\u30ba\u3092\u8abf\u6574\u3059\u308bPHP"},"content":{"rendered":"

WordPress\u30c6\u30fc\u30de\u300ctanzaku\u300d\u306e\u753b\u50cf\u30b5\u30a4\u30ba\u3092\u8abf\u6574\u3059\u308bJS<\/a><\/p>\n

\u6628\u65e5\u306f\u3001\u753b\u50cf\u306e\u6bd4\u7387\u3092\u8abf\u6574\u3059\u308b\u305f\u3081\u306eJS\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n

\u4eca\u56de\u306f\u8a73\u7d30\u30da\u30fc\u30b8\u306bMedium 640\u3092\u8cbc\u3063\u305f\u753b\u50cf\u3092\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3084\u691c\u7d22\u30da\u30fc\u30b8\u3067\u305d\u306e\u307e\u307e\u8868\u793a\u3059\u308b\u3068\u753b\u50cf\u30b5\u30a4\u30ba\u3082\u5927\u304d\u3044\u305f\u3081\u3001\u8aad\u307f\u8fbc\u307f\u306b\u591a\u5c11\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30b5\u30e0\u30cd\u30a4\u30eb\u7528\u306eSmall 320\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u753b\u50cf\u306eURL\u3092\u7f6e\u63db\u3059\u308bPHP\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n

<\/p>\n

\r\nfunction replace_flickr_image_size($img, $size='n') {\r\n    $pattern = \"\/(farm[0-9]+\\.staticflickr\\.com\\\/.*_)(m|z|c|l|o)\\.(jpg|gif|png)\/\";\r\n    $replace = \"$1$size.$3\";\r\n    $img = preg_replace($pattern, $replace, $img);\r\n    return $img;\r\n}\r\n<\/pre>\n

\u3042\u3068\u306f\u3001\u3053\u308c\u3092101\u884c\u76ee\u4ed8\u8fd1\u3067\u751f\u6210\u3057\u3066\u3044\u308b\u30b0\u30ea\u30c3\u30c9\u7528\u753b\u50cf\u306eURL\u3092\u7f6e\u63db\u3057\u307e\u3059\u3002<\/p>\n

\r\n\/\/ check image link\r\n\/\/$chk_imglink = '\/(]*?)>)'. preg_quote($matches2[0], '\/') .'\/';\r\n$chk_imglink = '\/(<\/a>]*?)>)'. preg_quote($matches2[0], '\/') .'\/';\r\nif ($flg_img_forcelink) {\r\n    $grid_img = '<\/a>post_title) . '\">' . $grid_img . '<\/a>';\r\n}   \r\nelse if ( preg_match($chk_imglink, $content, $matches3) ) { \r\n    $grid_img = $matches3[1] . $grid_img . '';\r\n}   \r\n$grid_img = replace_flickr_image_size($grid_img);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

WordPress\u30c6\u30fc\u30de\u300ctanzaku\u300d\u306e\u753b\u50cf\u30b5\u30a4\u30ba\u3092\u8abf\u6574\u3059\u308bJS \u6628\u65e5\u306f\u3001\u753b\u50cf\u306e\u6bd4\u7387\u3092\u8abf\u6574\u3059\u308b\u305f\u3081\u306eJS\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304d\u307e\u3057\u305f\u3002 \u4eca\u56de\u306f\u8a73\u7d30\u30da\u30fc\u30b8\u306bMedium 640\u3092\u8cbc\u3063\u305f\u753b\u50cf\u3092\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3084 … \u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":2,"featured_media":9223372036854775807,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1980],"tags":[972],"_links":{"self":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/7075"}],"collection":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/comments?post=7075"}],"version-history":[{"count":0,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/posts\/7075\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media\/9223372036854775807"}],"wp:attachment":[{"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/media?parent=7075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/categories?post=7075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fukata.org\/wp-json\/wp\/v2\/tags?post=7075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}