我在开发主题以达到较高的数组键和值时有以下代码。使用{{image about}}}访问附件数组第一个键“image about”=>。。。
add_theme_support( \'starter-content\', [
\'widgets\' => [
// Place three core-defined widgets in the sidebar area
\'ju_sidebar\' => [
\'text_business_info\', \'search\', \'text_about\',
]
],
// Create the custom image attachments used as post thumbnails for pages
\'attachments\' => [
\'image-about\' => [
\'post_title\' => __(\'About\',\'udemy\'),
\'file\' => \'assets/images/about/1.jpg\',
],
],
\'posts\' => [
\'home\' => [
\'thumbnail\' => \'{{image-about}}\'
],
\'about\' => [
\'thumbnail\' => \'{{image-about}}\'
],
\'contact\' => [
\'thumbnail\' => \'{{image-about}}\'
],
\'blog\' => [
\'thumbnail\' => \'{{image-about}}\'
],
\'homepage-section\' => [
\'thumbnail\' => \'{{image-about}}\'
],
],
\'options\' => [
\'show_on_front\' => \'page\',
\'page_on_front\' => \'{{home}}\',
\'page_for_posts\' => \'{{blog}}\',
],
\'theme_mods\' => [
\'ju_facebook_handle\' => \'udemy\',
\'ju_twitter_handle\' => \'udemy\',
\'ju_instagram_handle\' => \'udemy\',
\'ju_email\' => \'udemy\',
\'ju_phone_number\' => \'udemy\',
\'ju_header_show_search\' => \'yes\',
\'ju_header_show_cart\' => \'yes\',
],
\'nav_menus\' => [
\'primary\' => array(
\'name\' => __(\'Primary Menu\',\'udemy\'),
\'items\' => array(
\'link_home\',
\'page_about\',
\'page_block\',
\'page_contact\',
),
),
\'secondary\' => array(
\'name\' => __(\'Secondary Menu\',\'udemy\'),
\'items\' => array(
\'link_home\',
\'page_about\',
\'page_block\',
\'page_contact\',
),
),
]
]);
我找不到任何与双花括号有关的反应。仅查找wp。自定义javascript符号或角度。但是他们都没有解释这种情况。
任何有关这方面的信息都会很有帮助