php - 样式在 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 导航栏删除它的样式。我想这与链接有关。
解决方案
检查 bootstrap css 是否没有加载到 single.php 上。它与 Bulma 框架冲突。
推荐阅读
- c - 变量存在于流程的哪些逻辑段中?
- ruby-on-rails - Rails - 根据排序对项目进行排序并更改标题
- c# - 多个 Blazor 应用程序,相同的托管。从第一个应用程序重定向到第二个应用程序。Azure 应用服务
- php - 用 Ajax 添加到购物车的 Woocommerce 产品的可变价格范围替换可变价格范围
- javascript - 重新加载 DOM 元素而不重新加载整个页面(修改源 html)
- java - 用户将数据传递给另一个类
- vue.js - 使用 Vue 和 Axios 渲染列表时如何解决这个问题?
- c - 如何使这段代码更短更准确这段代码只是一个基本代码如何使它更高效
- c++ - 从同一点恢复类方法而不使用 goto
- mongodb - 本地 MongoDB 服务器拒绝启动