{"id":112,"date":"2022-07-24T11:20:00","date_gmt":"2022-07-24T02:20:00","guid":{"rendered":"http:\/\/52.196.21.54.nip.io\/techblog\/?p=112"},"modified":"2022-07-16T23:22:36","modified_gmt":"2022-07-16T14:22:36","slug":"wordpress%e3%81%aelink%e3%82%bf%e3%82%b0%e3%83%bbscript%e3%82%bf%e3%82%b0%e3%81%a7%e3%80%81typetext-css%e3%83%bbtypetext-javascript%e3%82%92%e5%89%8a%e9%99%a4%e3%81%99%e3%82%8b%e6%96%b9","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2022\/07\/24\/112\/","title":{"rendered":"WordPress\u306elink\u30bf\u30b0\u30fbscript\u30bf\u30b0\u3067\u3001type=&#8221;text\/css&#8221;\u30fbtype=&#8221;text\/javascript&#8221;\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>WHATWG\u306e<a href=\"https:\/\/whatwg.org\/validator\/\" data-type=\"URL\" data-id=\"https:\/\/whatwg.org\/validator\/\" target=\"_blank\" rel=\"noreferrer noopener\">HTML\u30c1\u30a7\u30c3\u30ab\u30fc<\/a>\u3092\u4f7f\u3063\u3066\u3001\u81ea\u5206\u304c\u6b63\u3057\u3044HTML\u3092\u66f8\u3051\u3066\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u4eba\u3082\u591a\u3044\u3068\u601d\u3046\u3002<br>\u4e00\u90e8\u306e\uff08\u3061\u3087\u3063\u3068\u3081\u3093\u3069\u304f\u3055\u3044\uff09\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u3001\u300c\u3053\u306e\u30c4\u30fc\u30eb\u3067\u30a8\u30e9\u30fc\u3084\u8b66\u544a\u3092\u30bc\u30ed\u306b\u3059\u308b\u3053\u3068\u300d\u3068\u8a00\u308f\u308c\u305f\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092\u4f7f\u3063\u305f\u4eba\u306f\u308f\u304b\u308b\u3068\u601d\u3046\u304c\u30012022\u5e74\u73fe\u5728<code>type=\"text\/css\"<\/code>\u3084<code>type=\"text\/javascript\"<\/code>\u3092\u524a\u9664\u3059\u308b\u3088\u3046\u306b\u8a00\u308f\u308c\u3066\u3057\u307e\u3046\u3002<br>\u500b\u4eba\u7684\u306b\u306f\u3069\u3063\u3061\u3067\u3082\u3044\u3044\u6c17\u304c\u3059\u308b\u304c\u3001WordPress\u3067\u7c21\u5358\u306b\u6d88\u3059\u65b9\u6cd5\u3092\u7d39\u4ecb\u3002<\/p>\n\n\n\n<p>WordPress\u3067CSS\u3084JS\u3092\u8aad\u307f\u8fbc\u3080\u6642\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u66f8\u3044\u3066\u3044\u308b\u3068\u601d\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function main_theme_scripts() {\n\twp_enqueue_style(\n\t\t'theme-style',\n\t\tget_template_directory_uri() . '\/style.css',\n\t\tarray(),\n\t\t1.0\n\t);\n\twp_enqueue_script(\n\t\t'theme-script',\n\t\tget_template_directory_uri() . '\/js\/script.js',\n\t\tarray( 'jquery' ),\n\t\t1.0,\n\t\tfalse\n\t);\n}\nadd_action( 'wp_enqueue_scripts', 'main_theme_scripts' );<\/code><\/pre>\n\n\n\n<p>\u6d88\u3057\u65b9\u306f\u3053\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ type=\"text\/css\"\u524a\u9664\nadd_filter('style_loader_tag', function ( $tag ) {\n\treturn preg_replace( '\/type=.text\\\/css.\/', '', $tag );\n});\n\n\/\/ type=\"text\/javascript\"\u524a\u9664\nadd_filter('script_loader_tag', function ( $tag ) {\n\treturn preg_replace( '\/type=.text\\\/javascript.\/', '', $tag );\n});<\/code><\/pre>\n\n\n\n<p><code>type=\"text\/css\"<\/code>\u3067\u3082<code>type='text\/css'<\/code>\u3067\u3082\u884c\u3051\u308b\u3088\u3046\u306b\u3001\u6b63\u898f\u8868\u73fe\u306b\u3057\u3066\u307f\u305f\u3002<br>\u3053\u308c\u3060\u3051\u3067\u5168\u3066\u306e\u30bf\u30b0\u306e\u5c5e\u6027\u306f\u6d88\u305b\u306a\u3044\u306e\u3060\u304c\u3001\u5c11\u3057\u3059\u3063\u304d\u308a\u3059\u308b\u3068\u601d\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"WHATWG\u306eHTML\u30c1\u30a7\u30c3\u30ab\u30fc\u3092\u4f7f\u3063\u3066\u3001\u81ea\u5206\u304c\u6b63\u3057\u3044HTML\u3092\u66f8\u3051\u3066\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u4eba\u3082\u591a\u3044\u3068\u601d\u3046\u3002\u4e00\u90e8\u306e\uff08\u3061\u3087\u3063\u3068\u3081\u3093\u3069\u304f\u3055\u3044\uff09\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u3001\u300c\u3053\u306e\u30c4\u30fc\u30eb\u3067\u30a8\u30e9\u30fc\u3084\u8b66\u544a\u3092\u30bc\u30ed\u306b\u3059\u308b\u3053\u3068\u300d\u3068\u8a00\u308f\u308c\u305f\u3053\u3068\u304c [&hellip;]","protected":false},"author":1,"featured_media":126,"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":[51,53,52,10],"class_list":["post-112","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backend","category-frontend","tag-html","tag-php","tag-wordpress","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2022\/07\/garbage-g4374a6513_1920.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/112","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=112"}],"version-history":[{"count":2,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":114,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/112\/revisions\/114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/126"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}