首页 > 解决方案 > 样式在 index.php 上有效,但在 single.php 上消失

问题描述

我正在尝试在 single.php 中输出 woocommerce 产品。但是由于某种我无法弄清楚的原因,样式中断了,尽管它在索引页面上运行良好。

无需从数据库中循环任何内容,只需要 get_header 函数和 get_footer 函数

function styles_and_scripts(){
  wp_enqueue_style('style', get_stylesheet_uri());
  wp_enqueue_style('bulma', get_stylesheet_directory_uri().'/assets/css/bulma.css', null, false);
}
add_action('wp_enqueue_scripts', 'styles_and_scripts');

Bulma 导航栏删除它的样式。我想这与链接有关。

标签: phpwordpress

解决方案


检查 bootstrap css 是否没有加载到 single.php 上。它与 Bulma 框架冲突。


推荐阅读