લેખ ડિરેક્ટરી
સ્થાનિક કમ્પ્યુટર પર ટેસ્ટ રિપ્લેસમેન્ટવર્ડપ્રેસથીમ, થીમને કસ્ટમાઇઝ કરવાનો પ્રયાસ કરતી વખતે, મને નીચેની જીવલેણ ભૂલ મળે છે ▼
વર્ડપ્રેસ કસ્ટમ થીમ સાથે જીવલેણ ભૂલ?
જો તમને WordPress કસ્ટમ થીમ અને બેકગ્રાઉન્ડ મેનૂ ખોલતી વખતે નીચેની જેમ જીવલેણ ભૂલ આવે છે:
Fatal error: Uncaught exception 'Exception' with message 'Supplied nav_menu_item value missing property: description' in D:\xampp\htdocs\wp\ceshimuban\wp-includes\customize\class-wp-customize-nav-menu-item-setting.php:183 Stack trace: #0 D:\xampp\htdocs\wp\ceshimuban\wp-includes\class-wp-customize-nav-menus.php(820): WP_Customize_Nav_Menu_Item_Setting->__construct(Object(WP_Customize_Manager), 'nav_menu_item[1...', Array) #1 [internal function]: WP_Customize_Nav_Menus->customize_register(Object(WP_Customize_Manager)) #2 D:\xampp\htdocs\wp\ceshimuban\wp-includes\class-wp-hook.php(303): call_user_func_array(Array, Array) #3 D:\xampp\htdocs\wp\ceshimuban\wp-includes\class-wp-hook.php(327): WP_Hook->apply_filters('', Array) #4 D:\xampp\htdocs\wp\ceshimuban\wp-includes\plugin.php(470): WP_Hook->do_action(Array) #5 D:\xampp\htdocs\wp\ceshimuban\wp-includes\class-wp-customize-manager.php(933): do_action('customize_regis...', Object(WP_Customize_Manager)) #6 [internal function]: WP_Customize_Manager->wp_loaded('') #7 D:\xampp\htd in D:\xampp\htdocs\wp\ceshimuban\wp-includes\customize\class-wp-customize-nav-menu-item-setting.php on line 183 There has been a critical error on this website. Please check your site admin email inbox for instructions. Learn more about troubleshooting WordPress.
સપ્લાય nav_menu_item મૂલ્ય ગુમ થયેલ મિલકતને કેવી રીતે ઠીક કરવી: description'?
અમે આ વર્ડપ્રેસ થીમમાં કરી શકીએ છીએfunction.php
ફાઇલ, તેને ઠીક કરવા માટે નીચેનો કોડ ઉમેરો:
/** * 解决WordPress自定义主题时出现致命错误 By 陈沩亮博客 * https://www.chenweiliang.com/cwl-19302.html **/ add_filter('wp_get_nav_menu_items', 'my_wp_get_nav_menu_items', 10, 3); function my_wp_get_nav_menu_items($items, $menu, $args) { foreach($items as $key => $item) $items[$key]->description = ''; return $items; }
ચેન વેઇલીંગપરીક્ષણ કરેલ, વર્ડપ્રેસ થીમ્સfunction.php
ફાઇલમાં, ઉપરોક્ત કોડ ઉમેર્યા પછી, તે વર્ડપ્રેસની ઘાતક ભૂલની સમસ્યાને હલ કરી શકે છે: 'સપ્લાય કરેલ nav_menu_item વેલ્યુ મિસિંગ પ્રોપર્ટી: વર્ણન' સાથેનો અપવાદ 'અપવાદ'.
હોપ ચેન વેઇલિયાંગ બ્લોગ ( https://www.chenweiliang.com/ ) શેર કર્યું "જો WordPress કસ્ટમ થીમમાં ઘાતક ભૂલ હોય તો મારે શું કરવું જોઈએ? તેને ઉકેલવા માટે કોડ ઉમેરો", જે તમને મદદરૂપ છે.
આ લેખની લિંક શેર કરવા માટે આપનું સ્વાગત છે:https://www.chenweiliang.com/cwl-19302.html
નવીનતમ અપડેટ્સ મેળવવા માટે ચેન વેઇલિઆંગના બ્લોગની ટેલિગ્રામ ચેનલ પર આપનું સ્વાગત છે!
📚 આ માર્ગદર્શિકામાં ઘણું મૂલ્ય છે, 🌟આ એક દુર્લભ તક છે, તેને ચૂકશો નહીં! ⏰⌛💨
ગમે તો શેર કરો અને લાઈક કરો!
તમારી શેરિંગ અને લાઈક્સ એ અમારી સતત પ્રેરણા છે!