修正方法がわからない 2 種類のエラーが発生しています。
ここでエラーを確認できます: http://www.brainbuzzmedia.com/themes/vertex/
最初のタイプは 2 回発生し、次のようになります。
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/admin/buzz/themes/vertex/wp-includes/functions.php on line 3587
functions.php で呼び出しがあります。
function my_init() {
if (!is_admin()) {
wp_enqueue_script('jquery');
}
}
add_action('init', 'my_init');
2 番目のエラー タイプは次のとおりです。
Notice: Undefined property: stdClass::$slider_height in /vertex/wp-content/themes/vertex/slider_settings.php on line 32
どこ (if ステートメントの内側または外側、またはその両方) に関係なく、これらの変数を定義しても、このエラーが発生します。
*更新
主に管理領域に使用される、テーマのファイルのサブフォルダーにキューに入れられた他のスクリプトがいくつかあります。
$path = get_template_directory_uri() . '/includes/metabox/smart_meta_box/smart_meta_fields/layout-editor/';
wp_enqueue_script('mcolorpicker', $path . 'js/mColorPicker.js', array('jquery'));
wp_enqueue_style('chosen', $path .'css/chosen.css');
wp_enqueue_style('content-layout', $path .'css/content-layout.css');
wp_enqueue_script('jquery-json', $path . 'js/jquery.json.js', array('jquery'));
wp_enqueue_script('chosen-jquery', $path . 'js/chosen.jquery.min.js', array('jquery'));
wp_enqueue_script('content-layout-js', $path . 'js/content-layout.js', array('jquery', 'jquery-ui-sortable'));
フロントエンドのディスプレイにも必要になるのではないかと思います。これらを正しい方法でキューに入れるにはどうすればよいですか?
- 更新 2
未定義のプロパティ エラーのうち 2 つが発生するコードを次に示します。