css 将Web字体添加到主题和页面构建器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 将Web字体添加到主题和页面构建器相关的知识,希望对你有一定的参考价值。

/* Use this rule to make the custom font the default font */
body {
  font-family: "Forza Book", Verdana, Arial, sans-serif !important;
}

/* Use this rule to apply the custom font to menu items */
.fl-page-nav .navbar-nav,
.fl-page-nav .navbar-nav a {
  font-family: "Forza Book", Verdana, Arial, sans-serif;
}

/* Use this rule to apply the custom font to headings */
h1, h2, h3, h4, h5, h6 {
  font-family: "Forza Book", Verdana, Arial, sans-serif;
}

/* Use this rule to apply the custom font to paragraphs */
p {
  font-family: "Forza Book", Verdana, Arial, sans-serif;
}
<?php // Do not copy this line, start with line 3

function my_bb_custom_fonts ( $system_fonts ) {

  $system_fonts[ 'Forza Book' ] = array(
    'fallback' => 'Verdana, Arial, sans-serif',
    'weights' => array(
        '400',
    ),
  );

  return $system_fonts;
}

//Add to Beaver Builder Theme Customizer
add_filter( 'fl_theme_system_fonts', 'my_bb_custom_fonts' );

//Add to Page Builder modules
add_filter( 'fl_builder_font_families_system', 'my_bb_custom_fonts' );
/* Add your custom styles here */
@font-face {
  font-family: "forza-book";
  src:  url("fonts/forza-book.woff2") format("woff2"),
        url("fonts/forza-book.woff") format("woff");
  font-weight: normal;
}

以上是关于css 将Web字体添加到主题和页面构建器的主要内容,如果未能解决你的问题,请参考以下文章

php 将自定义图标字体添加到WPBakery页面构建器

使用 Webpack 将选择器全局添加到我的所有 CSS 选择器(在构建时)

将自定义 css 添加到 wordpress 中的页面模板

php 向主题添加自定义CSS和字体

我可以将 Twig 块从一页过滤到另一页吗?

如何添加自定义字体? [复制]