【WordPress】プラグインが動かなくなったら確認する事
WordPress

【WordPress】プラグインが動かなくなったら確認する事

作成日:2021年04月27日
更新日:2021年04月27日

WordPress でサイトを制作している時、プラグインを追加して設置しただけなのに、動かなかったことはありませんか?

今回は、WordPress のプラグインが動かなかった時の対応を紹介します。

プラグインの『Contact Form 7』と『Date and Time Picker by Input WP』を例に上げてみます。

プラグインについて

Contact Form 7

『Contact Form 7』は、簡単に問い合わせフォームが作れてしまうプラグインです。

image2

Date and Time Picker by Input WP

『Date and Time Picker by Input WP』は、フォームの中で日付ピッカーを設置することができるプラグインです。

image3

どちらも設置するまでに 5 分とかからないくらい簡単にできるプラグインです。

しかし、『Date and Time Picker by Input WP』が動かなく、途方に暮れてしまいました。

image4

私は、『Date and Time Picker by Input WP』が動かなく、3 日間悩み続けました。

原因

原因は、footer.php のwp_footer();がなかったためです。

image5

新規で WordPress をインストールした場合、wp_footer();は書かれているのですが、既存のサイトを修正したため、wp_footer();がないことに気が付かなかったのです。

image6

では、wp_footer();とは、どのくらい重要なものなのでしょうか?

wp_footer();とは

試しに、wp_footer();がある場合とない場合で、ソースを比較してみましょう。

wp_footer();がある場合

php
<script>document.body.classList.remove("no-js");</script> <script>
if ( -1 !== navigator.userAgent.indexOf( 'MSIE' ) || -1 !== navigator.appVersion.indexOf( 'Trident/' ) ) {
document.body.classList.add( 'is-IE' );
}
</script>
<script src='http://test.local/wp-includes/js/hoverintent-js.min.js?ver=2.2.1' id='hoverintent-js-js'></script>
<script src='http://test.local/wp-includes/js/admin-bar.min.js?ver=5.7.1' id='admin-bar-js'></script>
<script src='http://test.local/wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=7.4.4' id='wp-polyfill-js'></script>
<script id='wp-polyfill-js-after'>
( 'fetch' in window ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-fetch.min.js?ver=3.0.0"></scr' + 'ipt>' );( document.contains ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-node-contains.min.js?ver=3.42.0"></scr' + 'ipt>' );( window.DOMRect ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-dom-rect.min.js?ver=3.42.0"></scr' + 'ipt>' );( window.URL && window.URL.prototype && window.URLSearchParams ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-url.min.js?ver=3.6.4"></scr' + 'ipt>' );( window.FormData && window.FormData.prototype.keys ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-formdata.min.js?ver=3.0.12"></scr' + 'ipt>' );( Element.prototype.matches && Element.prototype.closest ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js?ver=2.0.2"></scr' + 'ipt>' );( 'objectFit' in document.documentElement.style ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-object-fit.min.js?ver=2.3.4"></scr' + 'ipt>' );
</script>
<script src='http://test.local/wp-includes/js/dist/hooks.min.js?ver=50e23bed88bcb9e6e14023e9961698c1' id='wp-hooks-js'></script>
<script src='http://test.local/wp-includes/js/dist/i18n.min.js?ver=db9a9a37da262883343e941c3731bc67' id='wp-i18n-js'></script>
<script id='wp-i18n-js-after'>
wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } );
</script>
<script src='http://test.local/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.19' id='lodash-js'></script>
<script id='lodash-js-after'>
window.lodash = _.noConflict();
</script>
<script src='http://test.local/wp-includes/js/dist/url.min.js?ver=0ac7e0472c46121366e7ce07244be1ac' id='wp-url-js'></script>
<script id='wp-api-fetch-js-translations'>
( function( domain, translations ) {
var localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
localeData[""].domain = domain;
wp.i18n.setLocaleData( localeData, domain );
} )( "default", {"translation-revision-date":"2021-04-20 23:32:04+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"ja_JP"},"You are probably offline.":["\u73fe\u5728\u30aa\u30d5\u30e9\u30a4\u30f3\u306e\u3088\u3046\u3067\u3059\u3002"],"Media upload failed. If this is a photo or a large image, please scale it down and try again.":["\u30e1\u30c7\u30a3\u30a2\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 \u5199\u771f\u307e\u305f\u306f\u5927\u304d\u306a\u753b\u50cf\u306e\u5834\u5408\u306f\u3001\u7e2e\u5c0f\u3057\u3066\u3082\u3046\u4e00\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002"],"The response is not a valid JSON response.":["\u8fd4\u7b54\u304c\u6b63\u3057\u3044 JSON \u30ec\u30b9\u30dd\u30f3\u30b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"],"An unknown error occurred.":["\u4e0d\u660e\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002"]}},"comment":{"reference":"wp-includes\/js\/dist\/api-fetch.js"}} );
</script>
<script src='http://test.local/wp-includes/js/dist/api-fetch.min.js?ver=a783d1f442d2abefc7d6dbd156a44561' id='wp-api-fetch-js'></script>
<script id='wp-api-fetch-js-after'>
wp.apiFetch.use( wp.apiFetch.createRootURLMiddleware( "http://test.local/wp-json/" ) );
wp.apiFetch.nonceMiddleware = wp.apiFetch.createNonceMiddleware( "ef92e7c4f5" );
wp.apiFetch.use( wp.apiFetch.nonceMiddleware );
wp.apiFetch.use( wp.apiFetch.mediaUploadMiddleware );
wp.apiFetch.nonceEndpoint = "http://test.local/wp-admin/admin-ajax.php?action=rest-nonce";
</script>
<script id='contact-form-7-js-extra'>
var wpcf7 = [];
</script>
<script src='http://test.local/wp-content/plugins/contact-form-7/includes/js/index.js?ver=5.4' id='contact-form-7-js'></script>
<script id='twenty-twenty-one-ie11-polyfills-js-after'>
( Element.prototype.matches && Element.prototype.closest && window.NodeList && NodeList.prototype.forEach ) || document.write( '<script src="http://test.local/wp-content/themes/twentytwentyone/assets/js/polyfills.js?ver=1.3"></scr' + 'ipt>' );
</script>
<script src='http://test.local/wp-content/themes/twentytwentyone/assets/js/responsive-embeds.js?ver=1.3' id='twenty-twenty-one-responsive-embeds-script-js'></script>
<script src='http://test.local/wp-content/plugins/date-time-picker-field/assets/js/vendor/moment/moment.js?ver=5.7.1' id='dtp-moment-js'></script>
<script src='http://test.local/wp-content/plugins/date-time-picker-field/assets/js/vendor/datetimepicker/jquery.datetimepicker.full.min.js?ver=5.7.1' id='dtpicker-js'></script>
<script id='dtpicker-build-js-extra'>
var datepickeropts = {"selector":".DatePicker","datepicker":"on","timepicker":"off","minDate":"off","min_date":"","max_date":"","days_offset":"0","dateformat":"YYYY-MM-DD","step":"30","minTime":"00:00","maxTime":"23:59","offset":"0","hourformat":"HH:mm","inline":"off","placeholder":"off","preventkeyboard":"off","locale":"en","theme":"default","load":"full","disabled_days":"","disabled_calendar_days":"","allowed_times":"","sunday_times":"","monday_times":"","tuesday_times":"","wednesday_times":"","thursday_times":"","friday_times":"","saturday_times":"","dayOfWeekStart":"1","i18n":{"en":{"months":["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],"dayOfWeekShort":["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],"dayOfWeek":["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"]}},"format":"YYYY-MM-DD","clean_format":"Y-m-d","value":"2021-04-27","timezone":"","utc_offset":"+0","now":"2021-04-27"};
</script>
<script src='http://test.local/wp-content/plugins/date-time-picker-field/assets/js/dtpicker.js?ver=5.7.1' id='dtpicker-build-js'></script>
<script src='http://test.local/wp-includes/js/wp-embed.min.js?ver=5.7.1' id='wp-embed-js'></script>
<script>
/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1);
</script>

wp_footer();がない場合

php
<!-- <script>document.body.classList.remove("no-js");</script> <script>
if ( -1 !== navigator.userAgent.indexOf( 'MSIE' ) || -1 !== navigator.appVersion.indexOf( 'Trident/' ) ) {
document.body.classList.add( 'is-IE' );
}
</script>
<script src='http://test.local/wp-includes/js/hoverintent-js.min.js?ver=2.2.1' id='hoverintent-js-js'></script>
<script src='http://test.local/wp-includes/js/admin-bar.min.js?ver=5.7.1' id='admin-bar-js'></script>
<script src='http://test.local/wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=7.4.4' id='wp-polyfill-js'></script>
<script id='wp-polyfill-js-after'>
( 'fetch' in window ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-fetch.min.js?ver=3.0.0"></scr' + 'ipt>' );( document.contains ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-node-contains.min.js?ver=3.42.0"></scr' + 'ipt>' );( window.DOMRect ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-dom-rect.min.js?ver=3.42.0"></scr' + 'ipt>' );( window.URL && window.URL.prototype && window.URLSearchParams ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-url.min.js?ver=3.6.4"></scr' + 'ipt>' );( window.FormData && window.FormData.prototype.keys ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-formdata.min.js?ver=3.0.12"></scr' + 'ipt>' );( Element.prototype.matches && Element.prototype.closest ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js?ver=2.0.2"></scr' + 'ipt>' );( 'objectFit' in document.documentElement.style ) || document.write( '<script src="http://test.local/wp-includes/js/dist/vendor/wp-polyfill-object-fit.min.js?ver=2.3.4"></scr' + 'ipt>' );
</script>
<script src='http://test.local/wp-includes/js/dist/hooks.min.js?ver=50e23bed88bcb9e6e14023e9961698c1' id='wp-hooks-js'></script>
<script src='http://test.local/wp-includes/js/dist/i18n.min.js?ver=db9a9a37da262883343e941c3731bc67' id='wp-i18n-js'></script>
<script id='wp-i18n-js-after'>
wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } );
</script>
<script src='http://test.local/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.19' id='lodash-js'></script>
<script id='lodash-js-after'>
window.lodash = _.noConflict();
</script>
<script src='http://test.local/wp-includes/js/dist/url.min.js?ver=0ac7e0472c46121366e7ce07244be1ac' id='wp-url-js'></script>
<script id='wp-api-fetch-js-translations'>
( function( domain, translations ) {
var localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
localeData[""].domain = domain;
wp.i18n.setLocaleData( localeData, domain );
} )( "default", {"translation-revision-date":"2021-04-20 23:32:04+0000","generator":"GlotPress\/3.0.0-alpha.2","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural-forms":"nplurals=1; plural=0;","lang":"ja_JP"},"You are probably offline.":["\u73fe\u5728\u30aa\u30d5\u30e9\u30a4\u30f3\u306e\u3088\u3046\u3067\u3059\u3002"],"Media upload failed. If this is a photo or a large image, please scale it down and try again.":["\u30e1\u30c7\u30a3\u30a2\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 \u5199\u771f\u307e\u305f\u306f\u5927\u304d\u306a\u753b\u50cf\u306e\u5834\u5408\u306f\u3001\u7e2e\u5c0f\u3057\u3066\u3082\u3046\u4e00\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002"],"The response is not a valid JSON response.":["\u8fd4\u7b54\u304c\u6b63\u3057\u3044 JSON \u30ec\u30b9\u30dd\u30f3\u30b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"],"An unknown error occurred.":["\u4e0d\u660e\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002"]}},"comment":{"reference":"wp-includes\/js\/dist\/api-fetch.js"}} );
</script>
<script src='http://test.local/wp-includes/js/dist/api-fetch.min.js?ver=a783d1f442d2abefc7d6dbd156a44561' id='wp-api-fetch-js'></script>
<script id='wp-api-fetch-js-after'>
wp.apiFetch.use( wp.apiFetch.createRootURLMiddleware( "http://test.local/wp-json/" ) );
wp.apiFetch.nonceMiddleware = wp.apiFetch.createNonceMiddleware( "ef92e7c4f5" );
wp.apiFetch.use( wp.apiFetch.nonceMiddleware );
wp.apiFetch.use( wp.apiFetch.mediaUploadMiddleware );
wp.apiFetch.nonceEndpoint = "http://test.local/wp-admin/admin-ajax.php?action=rest-nonce";
</script>
<script id='contact-form-7-js-extra'>
var wpcf7 = [];
</script>
<script src='http://test.local/wp-content/plugins/contact-form-7/includes/js/index.js?ver=5.4' id='contact-form-7-js'></script>
<script id='twenty-twenty-one-ie11-polyfills-js-after'>
( Element.prototype.matches && Element.prototype.closest && window.NodeList && NodeList.prototype.forEach ) || document.write( '<script src="http://test.local/wp-content/themes/twentytwentyone/assets/js/polyfills.js?ver=1.3"></scr' + 'ipt>' );
</script>
<script src='http://test.local/wp-content/themes/twentytwentyone/assets/js/responsive-embeds.js?ver=1.3' id='twenty-twenty-one-responsive-embeds-script-js'></script>
<script src='http://test.local/wp-content/plugins/date-time-picker-field/assets/js/vendor/moment/moment.js?ver=5.7.1' id='dtp-moment-js'></script>
<script src='http://test.local/wp-content/plugins/date-time-picker-field/assets/js/vendor/datetimepicker/jquery.datetimepicker.full.min.js?ver=5.7.1' id='dtpicker-js'></script>
<script id='dtpicker-build-js-extra'>
var datepickeropts = {"selector":".DatePicker","datepicker":"on","timepicker":"off","minDate":"off","min_date":"","max_date":"","days_offset":"0","dateformat":"YYYY-MM-DD","step":"30","minTime":"00:00","maxTime":"23:59","offset":"0","hourformat":"HH:mm","inline":"off","placeholder":"off","preventkeyboard":"off","locale":"en","theme":"default","load":"full","disabled_days":"","disabled_calendar_days":"","allowed_times":"","sunday_times":"","monday_times":"","tuesday_times":"","wednesday_times":"","thursday_times":"","friday_times":"","saturday_times":"","dayOfWeekStart":"1","i18n":{"en":{"months":["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],"dayOfWeekShort":["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],"dayOfWeek":["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"]}},"format":"YYYY-MM-DD","clean_format":"Y-m-d","value":"2021-04-27","timezone":"","utc_offset":"+0","now":"2021-04-27"};
</script>
<script src='http://test.local/wp-content/plugins/date-time-picker-field/assets/js/dtpicker.js?ver=5.7.1' id='dtpicker-build-js'></script>
<script src='http://test.local/wp-includes/js/wp-embed.min.js?ver=5.7.1' id='wp-embed-js'></script>
<script>
/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1);
</script>
-->

script 内が全てコメントアウトしています。

つまり、wp_footer();は、WordPress に関するスクリプトを記述しているのです。

その中には、もちろん、『Date and Time Picker by Input WP』のスクリプトもありました。

image7

誤ってwp_footer();を消さないようにしましょう。

ちなみに、wp_footer();と同様に、wp_head();があります。

(おまけ)wp_head();

wp_head();がは header.php 内にありますので、ソースを見てみましょう。

php
<title>test</title>
<meta name='robots' content='max-image-preview:large' />
<link rel='dns-prefetch' href='//s.w.org' />
<link rel="alternate" type="application/rss+xml" title="test &raquo; フィード" href="http://test.local/feed/" />
<link rel="alternate" type="application/rss+xml" title="test &raquo; コメントフィード" href="http://test.local/comments/feed/" />
<script>
window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/svg\/","svgExt":".svg","source":{"concatemoji":"http:\/\/test.local\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.7.1"}};
!function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])?!1:!s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([55357,56424,8205,55356,57212],[55357,56424,8203,55356,57212])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(n=t.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<style>
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<link rel='stylesheet' id='dashicons-css' href='http://test.local/wp-includes/css/dashicons.min.css?ver=5.7.1' media='all' />
<link rel='stylesheet' id='admin-bar-css' href='http://test.local/wp-includes/css/admin-bar.min.css?ver=5.7.1' media='all' />
<link rel='stylesheet' id='wp-block-library-css' href='http://test.local/wp-includes/css/dist/block-library/style.min.css?ver=5.7.1' media='all' />
<link rel='stylesheet' id='wp-block-library-theme-css' href='http://test.local/wp-includes/css/dist/block-library/theme.min.css?ver=5.7.1' media='all' />
<link rel='stylesheet' id='contact-form-7-css' href='http://test.local/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=5.4' media='all' />
<link rel='stylesheet' id='twenty-twenty-one-style-css' href='http://test.local/wp-content/themes/twentytwentyone/style.css?ver=1.3' media='all' />
<style id='twenty-twenty-one-style-inline-css'>
body,input,textarea,button,.button,.faux-button,.wp-block-button__link,.wp-block-file__button,.has-drop-cap:not(:focus)::first-letter,.has-drop-cap:not(:focus)::first-letter,.entry-content .wp-block-archives,.entry-content .wp-block-categories,.entry-content .wp-block-cover-image,.entry-content .wp-block-latest-comments,.entry-content .wp-block-latest-posts,.entry-content .wp-block-pullquote,.entry-content .wp-block-quote.is-large,.entry-content .wp-block-quote.is-style-large,.entry-content .wp-block-archives *,.entry-content .wp-block-categories *,.entry-content .wp-block-latest-posts *,.entry-content .wp-block-latest-comments *,.entry-content p,.entry-content ol,.entry-content ul,.entry-content dl,.entry-content dt,.entry-content cite,.entry-content figcaption,.entry-content .wp-caption-text,.comment-content p,.comment-content ol,.comment-content ul,.comment-content dl,.comment-content dt,.comment-content cite,.comment-content figcaption,.comment-content .wp-caption-text,.widget_text p,.widget_text ol,.widget_text ul,.widget_text dl,.widget_text dt,.widget-content .rssSummary,.widget-content cite,.widget-content figcaption,.widget-content .wp-caption-text { font-family: sans-serif; }
</style>
<link rel='stylesheet' id='twenty-twenty-one-print-style-css' href='http://test.local/wp-content/themes/twentytwentyone/assets/css/print.css?ver=1.3' media='print' />
<link rel='stylesheet' id='dtpicker-css' href='http://test.local/wp-content/plugins/date-time-picker-field/assets/js/vendor/datetimepicker/jquery.datetimepicker.min.css?ver=5.7.1' media='all' />
<script src='http://test.local/wp-includes/js/jquery/jquery.min.js?ver=3.5.1' id='jquery-core-js'></script>
<link rel="https://api.w.org/" href="http://test.local/wp-json/" /><link rel="alternate" type="application/json" href="http://test.local/wp-json/wp/v2/pages/6" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://test.local/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://test.local/wp-includes/wlwmanifest.xml" />
<meta name="generator" content="WordPress 5.7.1" />
<link rel="canonical" href="http://test.local/6-2/" />
<link rel='shortlink' href='http://test.local/?p=6' />
<link rel="alternate" type="application/json+oembed" href="http://test.local/wp-json/oembed/1.0/embed?url=http%3A%2F%2Ftest.local%2F6-2%2F" />
<link rel="alternate" type="text/xml+oembed" href="http://test.local/wp-json/oembed/1.0/embed?url=http%3A%2F%2Ftest.local%2F6-2%2F&#038;format=xml" />
<style>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style><style media="print">#wpadminbar { display:none; }</style>
<style media="screen">
html { margin-top: 32px !important; }
* html body { margin-top: 32px !important; }
@media screen and ( max-width: 782px ) {
html { margin-top: 46px !important; }
* html body { margin-top: 46px !important; }
}
</style>

こちらは、WordPress のメタ情報やスタイルなどが書かれています。

wp_head();がない場合、以下の画像になります。

image8

wp_head();wp_footer();は非常に重要ですので、プラグインが動かなかったら、これらが書かれているか確認しましょう。

© 2024あずきぱんウェブスタジオ