{"id":108,"date":"2022-07-17T19:43:00","date_gmt":"2022-07-17T10:43:00","guid":{"rendered":"http:\/\/52.196.21.54.nip.io\/techblog\/?p=108"},"modified":"2022-07-16T23:00:27","modified_gmt":"2022-07-16T14:00:27","slug":"css%e3%82%ad%e3%83%a3%e3%83%83%e3%82%b7%e3%83%a5%e3%82%af%e3%83%aa%e3%82%a2%e3%82%92%e8%87%aa%e5%8b%95%e5%8c%96%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%81%a8%e6%b3%a8%e6%84%8f%e7%82%b9","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2022\/07\/17\/108\/","title":{"rendered":"CSS\u30ad\u30e3\u30c3\u30b7\u30e5\u30af\u30ea\u30a2\u3092\u81ea\u52d5\u5316\u3059\u308b\u65b9\u6cd5\u3068\u6ce8\u610f\u70b9"},"content":{"rendered":"\n<p>CSS\u3084JavaScript\u3092\u3044\u3058\u3063\u305f\u6642\u3001\u3044\u3061\u3044\u3061\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u300c\u30d6\u30e9\u30a6\u30b6\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3057\u3066\u304f\u3060\u3055\u3044\u300d\u306a\u3093\u3066\u8aac\u660e\u3059\u308b\u306e\u306f\u5909\u306a\u8a71\u3060\u3002<br>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u305d\u308c\u3067\u826f\u304f\u3066\u3082\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u3044\u3061\u3044\u3061\u30ad\u30e3\u30c3\u30b7\u30e5\u30af\u30ea\u30a2\u306a\u3093\u3066\u3057\u306a\u3044\u3002<br>\u81ea\u5206\u306fCSS\u306eURL\u672b\u7aef\u306b<code>style.css?ver=20200703<\/code>\u307f\u305f\u3044\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u3064\u3051\u3066\u3001CSS\u3092\u66f4\u65b0\u3059\u308b\u305f\u3073\u306b\u3053\u3053\u3092\u66f8\u304d\u63db\u3048\u3066\u3044\u305f\u3002<br>\u305d\u308c\u3092\u898b\u305f\u540c\u50da\u304c\u3082\u3063\u3068\u9762\u767d\u3044\u65b9\u6cd5\u3092\u8a66\u3057\u3066\u304f\u308c\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CSS\u30d5\u30a1\u30a4\u30eb\u306e\u66f4\u65b0\u65e5\u6642\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n\n\n\n<p><code>filemtime<\/code>\u3092\u4f7f\u3046\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u66f4\u65b0\u65e5\u6642\u304c\u53d6\u5f97\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$parm = filemtime('style.css');\n?&gt;\n\n&lt;link rel=\"stylesheet\" href=\"style.css?ver=&lt;?php echo $parm; ?&gt;\"&gt;<\/code><\/pre>\n\n\n\n<p>WordPress\u3060\u3068\u3053\u3093\u306a\u611f\u3058\u304b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function main_theme_scripts() {\n\t$parm = filemtime( get_template_directory() . '\/style.css' );\n\twp_enqueue_style(\n\t\t'theme-style',\n\t\tget_template_directory_uri() . '\/style.css',\n\t\tarray(),\n\t\t$parm\n\t);\n}\nadd_action( 'wp_enqueue_scripts', 'main_theme_scripts' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u65e5\u6642\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h2>\n\n\n\n<p>\u3053\u308c\u3060\u3051\u3067\u3082\u6a5f\u80fd\u306f\u679c\u305f\u3059\u304c\u3001\u3053\u308c\u307e\u3067\u306e\u3088\u3046\u306a\u5f62\u306b\u65e5\u6642\u3092\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3057\u305f\u3044\u3002<br>\u666e\u6bb5\u306a\u3089<code>date_i18n<\/code>\u3092\u4f7f\u3048\u3070WordPress\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306b\u5408\u308f\u305b\u3066\u5909\u63db\u3057\u3066\u304f\u308c\u308b\u306e\u3060\u304c\u3001\u306a\u305c\u304b<code>filemtime<\/code>\u3067\u3053\u308c\u306f\u4f7f\u3048\u306a\u3044\u3002<\/p>\n\n\n\n<p>\u3053\u3061\u3089\u306f\u30c0\u30e1\u306a\u4f8b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function main_theme_scripts() {\n\tdate_default_timezone_set('Asia\/Tokyo');\n\t$parm = date( 'ymdHi', filemtime( get_template_directory() . '\/style.css' ) );\n\twp_enqueue_style(\n\t\t'theme-style',\n\t\tget_template_directory_uri() . '\/style.css',\n\t\tarray(),\n\t\t$parm\n\t);\n}\nadd_action( 'wp_enqueue_scripts', 'main_theme_scripts' );<\/code><\/pre>\n\n\n\n<p><code>date_default_timezone_set<\/code>\u3057\u3066\u3057\u307e\u3046\u3068\u3001WordPress\u306e\u30c6\u30fc\u30de\u3084\u4ed6\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e0d\u5177\u5408\u3092\u5f15\u304d\u8d77\u3053\u3059\u539f\u56e0\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<p>\u6b63\u89e3\u306f\u3053\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function main_theme_scripts() {\n\t$parm = date( 'ymdHi', filemtime( get_template_directory() . '\/style.css' ) + 3600 * get_option('gmt_offset') );\n\twp_enqueue_style(\n\t\t'theme-style',\n\t\tget_template_directory_uri() . '\/style.css',\n\t\tarray(),\n\t\t$parm\n\t);\n}\nadd_action( 'wp_enqueue_scripts', 'main_theme_scripts' );<\/code><\/pre>\n\n\n\n<p><code>gmt_offset<\/code>\u3067GMT\u3068\u73fe\u5728\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u6642\u5dee\uff08\u6642\u9593\uff09\u304c\u53d6\u5f97\u3067\u304d\u308b\u3002<br>\u5358\u4f4d\u3092\u79d2\u306b\u3057\u305f\u3044\u306e\u30673600\u79d2\u3092\u639b\u3051\u7b97\u3057\u3066\u3001\u7d50\u679c\u3092<code>filemtime<\/code>\u306b\u8db3\u3057\u7b97\u3059\u308c\u3070OK\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f59\u8ac7<\/h2>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u30c6\u30fc\u30de\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\uff08<code>style.css<\/code>\u306b\u66f8\u304f\u3084\u3064\uff09\u3068\u4e00\u81f4\u3055\u305b\u308b\u3068\u3044\u3046\u624b\u3082\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function main_theme_scripts() {\n\t$my_theme = wp_get_theme();\n\twp_enqueue_style(\n\t\t'theme-style',\n\t\tget_template_directory_uri() . '\/style.css',\n\t\tarray(),\n\t\t$my_theme-&gt;get( 'Version' )\n\t);\n}\nadd_action( 'wp_enqueue_scripts', 'main_theme_scripts' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/frostmoon.net\/?p=189\" data-type=\"URL\" data-id=\"https:\/\/frostmoon.net\/?p=189\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress\u3067\u30d5\u30a1\u30a4\u30eb\u306e\u66f4\u65b0\u65e5\u6642\u3092\u53d6\u5f97\u3059\u308b \u2013 flow of water<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"CSS\u3084JavaScript\u3092\u3044\u3058\u3063\u305f\u6642\u3001\u3044\u3061\u3044\u3061\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u300c\u30d6\u30e9\u30a6\u30b6\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3057\u3066\u304f\u3060\u3055\u3044\u300d\u306a\u3093\u3066\u8aac\u660e\u3059\u308b\u306e\u306f\u5909\u306a\u8a71\u3060\u3002\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u305d\u308c\u3067\u826f\u304f\u3066\u3082\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u3044\u3061\u3044\u3061\u30ad\u30e3\u30c3\u30b7\u30e5\u30af\u30ea\u30a2\u306a\u3093\u3066\u3057\u306a\u3044\u3002\u81ea\u5206\u306f [&hellip;]","protected":false},"author":1,"featured_media":123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[39,47],"tags":[53,52,10],"class_list":["post-108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backend","category-frontend","tag-php","tag-wordpress","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2022\/07\/frustrated-g8914676a1_1920.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":6,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/108\/revisions\/125"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/123"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}