Glyphicons from bootstrap doesn't show up

后端 未结 4 927
花落未央
花落未央 2021-02-06 05:21
Administration
相关标签:
4条回答
  • 2021-02-06 05:51

    The file variables.less is at the bootstrap folder, so you need one more level to get to root.

    Try to set the path to:

    @iconSpritePath:          "../../img/glyphicons-halflings.png";
    @iconWhiteSpritePath:     "../../img/glyphicons-halflings-white.png";
    
    0 讨论(0)
  • 2021-02-06 05:57

    Open the rewrites.php file in the 'lib' folder. Add the following line within the function 'roots_add_rewrites($content)':

        'assets/fonts/(.*)'    => THEME_PATH . '/assets/fonts/$1',
    

    The function should look like this:

    function roots_add_rewrites($content) {
      global $wp_rewrite;
      $roots_new_non_wp_rules = array(
        'assets/css/(.*)'      => THEME_PATH . '/assets/css/$1',
        'assets/js/(.*)'       => THEME_PATH . '/assets/js/$1',
        'assets/img/(.*)'      => THEME_PATH . '/assets/img/$1',
        'assets/fonts/(.*)'    => THEME_PATH . '/assets/fonts/$1',
        'plugins/(.*)'         => RELATIVE_PLUGIN_PATH . '/$1'
      );
      $wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $roots_new_non_wp_rules);
      return $content;
    }
    
    0 讨论(0)
  • 2021-02-06 06:04

    In the newest Bootstrap icons are included with the new class glyphicon:

    <i class="glyphicon glyphicon-heart"></i>
    

    In some cases that will probably be the problem.

    0 讨论(0)
  • 2021-02-06 06:07

    I had to copy the img folder from bootstrap in the less folder... or you could change the variable to point to root/img folder.

    0 讨论(0)
提交回复
热议问题