You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WordPress中theme.json停止更新的问题排查求助

WordPress FSE theme.json 修改不生效且缓存异常

在WordPress FSE(全站编辑)项目开发多日,此前编辑theme.json修改/添加字体大小等配置均正常。但今日修改该文件后,网站样式无任何变化;删除文件后网站丢失所有样式,重新添加仅两行代码的theme.json时,仍加载昨日的旧配置。已尝试以下操作但均无效:

  • 重启开发服务器
  • 更换多款浏览器
  • 清除浏览器缓存

当前使用的theme.json代码

{    
    "$schema": "https://schemas.wp.org/trunk/theme.json",    
    "version": 2,    
    "settings": {        
        "appearanceTools": true,        
        "layout": {            
            "contentSize": "1140px",            
            "wideSize": "1140px"        
        },        
        "color": {            
            "palette": [                
                {                    
                    "slug": "CHE-Black",                    
                    "color": "#2c2c2c",                    
                    "name": "CHE-Black"                
                },                
                {                    
                    "slug": "CHE-White",                    
                    "color": "#fff",                    
                    "name": "CHE-White"                
                },                
                {                    
                    "slug": "CHE-Blue",                    
                    "color": "#0b76b5",                    
                    "name": "CHE-Blue"                
                },                
                {                    
                    "slug": "CHE-Blue-Light",                    
                    "color": "#9fb1bf",                    
                    "name": "CHE-Blue-Light"                
                },                
                {                    
                    "slug": "CHE-Red",                    
                    "color": "#ba2e24",                    
                    "name": "CHE-Red"                
                },                
                {                    
                    "slug": "CHE-Gold",                    
                    "color": "#d2aa50",                    
                    "name": "CHE-Gold"                
                },                
                {                    
                    "slug": "CHE-Grey",                    
                    "color": "#9a9a9a",                    
                    "name": "CHE-Grey"                
                }            
            ]        
        },        
        "spacing": {            
            "blockGap": true,            
            "margin": true,            
            "padding": true,            
            "units": [                
                "%",                
                "px",                
                "em",                
                "rem",                
                "vh",                
                "vw"            
            ]        
        },        
        "typography": {            
            "dropCap": true,            
            "fontStyle": true,            
            "fontWeight": true,            
            "letterSpacing": true,            
            "lineHeight": true,            
            "textDecoration": true,            
            "textTransform": true,            
            "fontFamilies": [{                
                "fontFamily": "serif",                
                "slug": "serif",                
                "name": "serif"            
            }            
            ],            
            "fontSizes": [                
                {                    
                    "size": "1.2em",                    
                    "slug": "p-standard",                    
                    "name": "p-standard"                
                },                
                {                    
                    "size": "2.5em",                    
                    "slug": "h2",                    
                    "name": "h2"                
                },                
                {                    
                    "size": "1.825em",                    
                    "slug": "h3",                    
                    "name": "h3"                
                },                
                {                    
                    "size": "1.5em",                    
                    "slug": "h4",                    
                    "name": "h4"                
                },                
                {                    
                    "size": "1.3em",                    
                    "slug": "h5",                    
                    "name": "h5"                
                },                
                {                    
                    "size": "0.9em",                    
                    "slug": "h6",                    
                    "name": "h6"                
                },                
                {                    
                    "size": "14px",                    
                    "slug": "nav",                    
                    "name": "nav"                
                },                
                {                    
                    "size": "13px",                    
                    "slug": "footer",                    
                    "name": "footer"                
                },                
                {                    
                    "size": "15px",                    
                    "slug": "button",                    
                    "name": "button"                
                }            
            ]        
        }    
    },    
    "templateParts": [        
        {            
            "name": "header",            
            "area": "header",            
            "title": "Header"        
        },        
        {            
            "name": "footer",            
            "area": "footer",            
            "title": "Footer"        
        }    
    ]
}

内容的提问来源于stack exchange,提问作者lisandro

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 08:40:21