My wordpress admin say this code NOT SURE
-
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2298
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2302
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2308
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2312
Notice: Trying to get property ‘ID’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2316
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2320
Notice: Trying to get property ‘ID’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2334
i never used this template in my life. Help me..
-
Some component of your project (the theme or a plugin) is calling a WordPress function incorrectly. This is what causes these messages.
To find the cause, I would recommend that you first change the theme to a standard theme (such as TwentyTwentyFour). You can do this in the backend under Appeareance > Themes. Will the messages then disappear? Then it was due to the theme you were using before and you would have to contact its developer.
If the messages are also visible with the standard theme, deactivate all plugins as a test. You can then activate them individually until the messages reappear. You should be able to find the culprit plugin this way.
Something ( a plugin or theme ) is doing something slightly badly which is resulting in a core WordPress function spitting out a notice. But these are notices, notices are not errors and should not normally be turned on to display on a production site.
See https://fullworksplugins.com/docs/plugins-general/troubleshooting-plugins-general/php-notices-and-warnings/Thanks for replying me back. i changed theme TwentyTwentyFour no error message shown.
nothing to do with plug in.
how do i know check old php code to fix? check all page?
Notice: Function is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031
Notice: Function is_search was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031
Recovery Mode not initialized. what is mean? another error i saw
If the error only occurs with the theme you are using, you must contact the developer of the theme so that they can fix the problem.
Notice: Function wp_enqueue_script() was called incorrectly. “wp-editor” script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031
not sure this error i find
You would have to search the theme you have developed for the functions mentioned. For example, for wp_enqueue_script(). Compare what you have written with the specifications in the manual: https://developer.www.ads-software.com/reference/functions/wp_enqueue_script/
Also activate debugging in WordPress to get more information about the error. See: https://www.ads-software.com/documentation/article/debugging-in-wordpress/
// テーマの機能をサポート /** カスタムメニュー機能を有効にするコード(CHAPTER 12)*/ add_theme_support( 'menus' ); add_theme_support('wp-block-styles'); add_theme_support('responsive-embeds'); add_theme_support('align-wide'); // ブロックエディタ用スタイル機能を追加 add_action('after_setup_theme', function () { add_theme_support('editor-styles'); // ブロックエディタ用CSSの読み込み add_editor_style('css/editor-style.css'); // テーマディレクトリからの相対パス }); // 管理画面用のスタイルを読み込む add_action('admin_enqueue_scripts', function ($hook_suffix) { $admin_style_path = get_template_directory() . "/css/admin-style.css"; $admin_style_uri = get_template_directory_uri() . "/css/admin-style.css"; $admin_style_version = file_exists($admin_style_path) ? filemtime($admin_style_path) : null; // CSSファイルの読み込み wp_enqueue_style("admin-style", $admin_style_uri, array(), $admin_style_version); }); // ブロックエディタに対してカスタムなCSSを適用 add_action('enqueue_block_editor_assets', function () { $editor_style_path = get_template_directory() . "/css/editor-style.css"; $editor_style_uri = get_template_directory_uri() . "/css/editor-style.css"; $editor_script_path = get_template_directory() . "/js/editor-style.js"; $editor_script_uri = get_template_directory_uri() . "/js/editor-style.js"; // ファイルの最終更新日時を取得 $editor_style_version = file_exists($editor_style_path) ? filemtime($editor_style_path) : null; $editor_script_version = file_exists($editor_script_path) ? filemtime($editor_script_path) : null; // CSSファイルの読み込み wp_enqueue_style("editor-style", $editor_style_uri, array(), $editor_style_version); // JSファイルの読み込み wp_enqueue_script('editor-script', $editor_script_uri, array('wp-blocks'), $editor_script_version, true); }); // その他の設定 add_theme_support('post-thumbnails'); // アイキャッチ画像のサポート add_image_size('thumb640', 640, 400, true); // カスタムサムネイルの追加 // バックグラウンド設定 $defaults = array( 'default-color' => '', 'default-image' => '', 'default-repeat' => '', 'default-position-x' => '', 'default-attachment' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support('custom-background', $defaults); // カスタム背景のサポート // 検索時の固定ページの除外 function my_posy_search($search) { if (is_search()) { $search .= " AND post_type = 'post'"; } return $search; } add_filter('posts_search', 'my_posy_search'); // 検索時に固定ページを除外 // SVGアップロードのサポート function add_svg_upload($file_types) { $add_filetypes = array('svg' => 'image/svg+xml'); $file_types = array_merge($file_types, $add_filetypes); return $file_types; } add_action('upload_mimes', 'add_svg_upload'); // SVGのアップロードサポート // 抜粋の文字数の設定 function twpp_change_excerpt_length($length) { return (wp_is_mobile()) ? 30 : 150; // モバイルとデスクトップで異なる文字数の抜粋 } add_filter('excerpt_length', 'twpp_change_excerpt_length', 999); // メニューのサポート add_theme_support('menus'); // メニューサポート register_nav_menu('Bootstrap-Naviwalker', 'global-navigation'); // ナビゲーションメニューの登録 // 抜粋の表示 function dess_get_excerpt($num_chars) { $temp_str = substr(strip_shortcodes(strip_tags(get_the_content())), 0, $num_chars); $temp_parts = explode(" ", $temp_str); $temp_parts[(count($temp_parts) - 1)] = ''; if (strlen(strip_tags(get_the_content())) > 125) { return implode(" ", $temp_parts) . '...'; } else { return implode(" ", $temp_parts); } } /* 投稿一覧管理画面にカスタムカラムを追加 */ function add_posts_columns($columns) { $columns['thumbnail'] = 'サムネイル'; $columns['postid'] = 'ID'; $columns['count'] = '文字数'; return $columns; } // 投稿一覧管理画面にサムネイル、ID、文字数を表示 function add_posts_columns_row($column_name, $post_id) { if ( 'thumbnail' == $column_name ) { $thumb = get_the_post_thumbnail($post_id, array(100,100), 'thumbnail'); echo ( $thumb ) ? $thumb : '-'; } elseif ( 'postid' == $column_name ) { echo $post_id; } elseif ( 'count' == $column_name ) { $count = mb_strlen(strip_tags(get_post_field('post_content', $post_id))); echo $count; } } add_filter( 'manage_posts_columns', 'add_posts_columns' ); add_action( 'manage_posts_custom_column', 'add_posts_columns_row', 10, 2 ); // 固定ページ一覧画面にサムネイル表示 function add_page_columns($columns) { $columns['thumbnail'] = 'サムネイル'; return $columns; } function add_page_column_row($column_name, $post_id) { if ( 'thumbnail' == $column_name ) { $thumb = get_the_post_thumbnail($post_id, array(100,100), 'thumbnail'); echo ( $thumb ) ? $thumb : '-'; } } add_filter( 'manage_pages_columns', 'add_page_columns'); add_action( 'manage_pages_custom_column', 'add_page_column_row', 10, 2); /* 固定ページ一覧にスラッグを追加する */ function add_page_column_slug_title( $columns ) { $columns[ 'slug' ] = "スラッグ"; return $columns; } function add_page_column_slug( $column_name, $post_id ) { if( $column_name == 'slug' ) { $post = get_post( $post_id ); $slug = $post->post_name; echo esc_attr( $slug ); } } add_filter( 'manage_pages_columns', 'add_page_column_slug_title' ); add_action( 'manage_pages_custom_column', 'add_page_column_slug', 10, 2 ); // 固定ページ一覧にページIDを追加 function add_page_id_column($columns) { $columns['page_id'] = 'Page ID'; return $columns; } function display_page_id_column($column, $post_id) { if ($column === 'page_id') { echo $post_id; } } add_filter('manage_pages_columns', 'add_page_id_column'); add_action('manage_pages_custom_column', 'display_page_id_column', 10, 2); /** メインカラムの幅を指定 */ if ( ! isset( $content_width ) ) $content_width = 600; /** <head>内に RSSフィードのリンクを表示 */ add_theme_support( 'automatic-feed-links' ); /** サイドバーを定義 */ register_sidebar( array( 'name' => 'サイドバーウィジット-1', 'id' => 'sidebar-1', 'description' => 'サイドバーのウィジットエリアです。デフォルトのサイドバーと丸ごと入れ替えたいときに使ってください。', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', ) ); register_sidebar( array( 'name' => 'サイドバーウィジット-2', 'id' => 'sidebar-2', 'description' => 'サイドバーのウィジットのテストです。', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', )); // HTML5 Blank navigation function html5blank_nav() { wp_nav_menu( array( 'theme_location' => 'side-menu', 'menu' => 'side-menu', 'container' => 'div', 'container_class' => 'menu-{menu slug}-container', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul>%3$s</ul>', 'depth' => '1. dropdown menu use', ) ); } // Register HTML5 Blank Navigation function register_html5_menu() { register_nav_menus(array( 'header-menu' => __('Header Menu', 'html5blank'), )); } //下記が参考リフェレンス /* <?php wp_nav_menu( array( 'menu' => '', //管理画面でつけたメニューの名前 'menu_id' => '{メニューのスラッグ}-{連番}', //メインのulタグにつけるid名 'menu_class' => 'menu', //メインのulタグにつけるクラス名 'container' => 'div', // メニューを何のタグで囲むか div nav false が利用できる。falseなら囲まない 'container_id' => '', //containerのid名 'container_class' => 'menu-{メニューのスラッグ}-container', // containerのクラス名 'fallback_cb' => 'wp_page_menu', // メニューが存在しない場合に呼び出す関数 'before' => '', // リンクテキストの前に表示するテキスト 'after' => '', // リンクテキストの後に表示するテキスト 'link_before' => '', // リンクの前に表示するテキスト 'link_after' => '', // リンクの後に表示するテキスト 'echo' => true, // true: HTML出力 false:phpで返す 'depth' => 0, // 何階層まで表示するか。0を指定すると全階層 'walker' => '', // 適用するカスタムウォーカーを指定 'theme_location' => '', // テーマの中で使われる位置。あらかじめ register_nav_menu() で登録しておく 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', //出力形式。 %1$s に 'menu_id'の値 、 %2$s に 'menu_class'の値 、%3$sにメニュー項目が展開される。%3$sは省略不可 ) ); ?>*/ /** 抜粋の[...]を...に変更するコード(CHAPTER 14)*/ function new_excerpt_more( $more ) { return ' ... '; } add_filter( 'excerpt_more', 'new_excerpt_more' ); //一つのアクションフックからファイルを読み込む方法 /*function my_styles() { wp_enqueue_style('my-style', get_theme_file_uri('/style.css')); } add_action( 'wp_enqueue_scripts', 'my_styles' ); */ // Google Fonts //function add_google_fonts() { //wp_enqueue_style('google_fonts_open_sans', 'https://fonts.googleapis.com/css2?family=Inter:wght@100;400&display=swap', array(), null); //} //add_action('wp_enqueue_scripts', 'add_google_fonts'); // Awesome Fonts function add_awesome_fonts() { wp_enqueue_script('awesome_fonts', 'https://kit.fontawesome.com/653858111e.js'); } add_action('wp_enqueue_scripts', 'add_awesome_fonts'); // CSSキャッシュ更新 function themebs_enqueue_styles() { $version = filemtime(get_template_directory() . '/style.css'); wp_enqueue_style('bootstrap_css', get_template_directory_uri() . '/css/bootstrap.css', array(), $version); wp_enqueue_style('bootstrap_custom', get_template_directory_uri() . '/css/bootstrap.custom.css', array(), $version); wp_enqueue_style('editor_style', get_template_directory_uri() . '/css/editor-style.css', array(), $version); wp_enqueue_style('lite-yt-embed', get_template_directory_uri() . '/css/lite-yt-embed.css', array(), $version); wp_enqueue_style('lite-vimeo-embed', get_template_directory_uri() . '/css/lite-vimeo-embed.css', array(), $version); wp_enqueue_style('style', get_stylesheet_uri(), array(), $version); wp_enqueue_style('swiper-style', get_template_directory_uri() . '/css/swiper-bundle.css', array(), $version); wp_enqueue_style('slicknav-custom', get_template_directory_uri() . '/css/slicknav.css', array(), $version); wp_enqueue_style('slick-slider', get_template_directory_uri() . '/css/slick.css', array(), $version); wp_enqueue_style('admin-style', get_template_directory_uri() . '/css/admin-style.css', array(), $version); wp_enqueue_style('lightbox_css', get_template_directory_uri() . '/css/lightbox.css', array(), $version); } add_action('wp_enqueue_scripts', 'themebs_enqueue_styles'); function themebs_enqueue_scripts() { $version = filemtime(get_template_directory() . '/js/scripts.js'); wp_enqueue_script('jquery-migrate', get_template_directory_uri() . '/js/jquery-migrate-3.3.2.js', array('jquery'), '3.3.2', true); wp_enqueue_script('bootstrap_min', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), $version); wp_enqueue_script('swiper-slider', get_template_directory_uri() . '/js/swiper-bundle.min.js', array('jquery'), $version); wp_enqueue_script('slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array('jquery'), $version); wp_enqueue_script('slick-slider', get_template_directory_uri() . '/js/slick.min.js', array('jquery'), $version); wp_enqueue_script('isotope', get_template_directory_uri() . '/js/isotope.pkgd.min.js', array('jquery'), $version); wp_enqueue_script('dotdot', get_template_directory_uri() . '/js/jquery.dotdotdot.min.js', array('jquery'), $version); wp_enqueue_script('imagesloaded', get_template_directory_uri() . '/js/imagesloaded.pkgd.min.js', array('jquery'), $version); wp_enqueue_script('js-script', get_template_directory_uri() . '/js/scripts.js', array('jquery'), $version); wp_enqueue_script('lite-yt-embed', get_template_directory_uri() . '/js/lite-yt-embed.js', array('jquery'), $version); wp_enqueue_script('lite-vimeo-embed', get_template_directory_uri() . '/js/lite-vimeo-embed.js', array('jquery'), $version); wp_enqueue_script('lightbox_min_js', get_template_directory_uri() . '/js/lightbox.min.js', array('jquery'), $version); // wp-editorを削除する wp_deregister_script('wp-editor'); } add_action('wp_enqueue_scripts', 'themebs_enqueue_scripts'); // 特定のID 9517 single.php 読み込んでlightboxを表示 // カスタムフィールドで読み込んでいる画像にlightboxで表示させている。 function enqueue_custom_lightbox_script() { if (is_single() && get_the_ID() == 9517) { $script_version = filemtime(get_template_directory() . '/js/scripts.js'); wp_enqueue_script('custom-lightbox', get_template_directory_uri() . '/js/scripts.js', array('jquery', 'lightbox_min_js'), $script_version, true); } } add_action('wp_enqueue_scripts', 'enqueue_custom_lightbox_script');
here are all code i am checking too
i changed to Twenty Twenty one or what ever Twenty still error massage shown.
i deactived all plugin but still error message too.
my blog
NOT SURE HOT TO ORDER…
wp_enqueue_script Order: The order in which scripts are loaded can be crucial. If, for instance, lightbox.min.js depends on jQuery, make sure to enqueue jQuery first. Multiple wp_enqueue_script Calls: Check if lightbox.min.js is being enqueued in multiple places. This can lead to conflicts. Make sure it's not being loaded redundantly. Unnecessary wp_enqueue_script Calls: Look for any unnecessary or outdated script calls. You might be loading an older version or a script that is no longer needed. jQuery Version Compatibility: Verify that the jQuery version aligns with the requirements of your scripts. lightbox.min.js might be dependent on a specific version of jQuery. Check these points and see if they help identify or resolve the issue. If the problem persists, sharing the error message and any additional details would be helpful.
Error shown in WordPress Appearence Widget area shown.
Notice: Function wp_enqueue_script() was called incorrectly. “wp-editor” script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031
Error shown in WordPress Appearence Customize area shown.
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2298
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2302
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2308
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2312
Notice: Trying to get property ‘ID’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2316
Notice: Trying to get property ‘post_status’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2320
Notice: Trying to get property ‘ID’ of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2334
-
This reply was modified 1 year, 2 months ago by
kazskater99.
I have put the code into a test theme and cannot reproduce the errors you see there. So it must still have something to do with your individual theme. Make the theme available for download somewhere (e.g. at gists) so that you can have a look at it.
-
This reply was modified 1 year, 2 months ago by
- The topic ‘My wordpress admin say this code NOT SURE’ is closed to new replies.