【问题标题】:WP OnePress custom fontWP OnePress 自定义字体
【发布时间】:2020-07-05 03:15:35
【问题描述】:

我正在尝试将“不包含”字体设置为 OnePress 模板。我尝试了插件等,但它不起作用。与 CSS 相同。例如,我使用了这个:


     @import url("https://use.typekit.net/zni3ajm.css");

    body, body p { 
        font-family: century-gothic,    sans-serif;
        font-weight: 400;
        font-style: normal;
     } 
     #page .site-branding .site-title, #page .site-branding .site-text-logo { 
        font-family: century-gothic,    sans-serif;
        font-weight: 400;
        font-style: normal;
     } 
     #page .site-branding .site-description { 
        font-family: century-gothic,    sans-serif;
        font-weight: 400;
        font-style: normal;
     } 
     .onepress-menu a { 
        font-family: century-gothic,    sans-serif;
        font-weight: 400;
        font-style: normal;
     } 
     .hero__content .hero-large-text, .hero__content .hcl2-content h1, .hero__content .hcl2-content h2, .hero__content .hcl2-content h3 { 
        font-family: century-gothic,    sans-serif;
        font-weight: 400;
        font-style: normal;
     } 
     body h1, body h2, body h3, body h4, body h5, body h6,
        .entry-header .entry-title,
        body .section-title-area .section-title, body .section-title-area .section-subtitle, body .hero-content-style1 h2 { 
        font-family: century-gothic,    sans-serif;
        font-weight: 400;
        font-style: normal;
     }

但它只更改导航栏文本,没有其他内容。

最奇怪的是:https://ctrlv.cz/VnU7 如果我进行该 CSS 编辑,它就可以工作。但是然后我点击发布,并且在原始页面上只更新了导航栏。有人可以帮我吗?

顺便说一句,我正在从 adobe creative cloud 导入。

编辑:我尝试了一种不同的字体,它可以工作!这怎么可能?我可以以某种方式修复它吗?

【问题讨论】:

    标签: css wordpress fonts webfonts


    【解决方案1】:

    使用@font-face 并直接在您的样式文件中导入字体

    例如

    @font-face {
    font-family:"century-gothic";
    src:url("https://use.typekit.net/af/afc5c6/00000000000000003b9b1f23/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff2"),url("https://use.typekit.net/af/afc5c6/00000000000000003b9b1f23/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff"),url("https://use.typekit.net/af/afc5c6/00000000000000003b9b1f23/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("opentype");
    font-display:auto;font-style:normal;font-weight:400;
    }
    

    然后在你的代码上使用它:

    body, body p { 
            font-family: century-gothic;
         } 
    

    【讨论】:

    • 并非所有英雄都穿斗篷!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-09-24
    • 2021-06-15
    • 2016-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多