dsm13698679318 2016-05-16 12:01
浏览 82

Wordpress CSS Frontpage无法正常工作

So I have xampp and currently trying to learn some Wordpress development. I've made a simple bootstrap page into Wordpress, but which ever page I put as my front page does not load any CSS, whilst the other pages work fine.

If I change the front page to a page that previously worked fine, it also loses the CSS.

https://i.gyazo.com/bcb75b7a7fa64cd99cb43bd1c3067324.png https://i.gyazo.com/7184fec113c09755961088fa69191528.png

What am I doing wrong here? I am running everything locally on 127.0.0.1

Thanks in advance for helping me !

  • 写回答

1条回答 默认 最新

  • douzuan5365 2016-05-16 12:17
    关注

    The proper way to add css in your files using WordPress to use the function wp_enqueue_style it will not override the css declaration but enqueue it

    In your functions.php

    function your_scripts() {
     wp_enqueue_style( 'filjoseph-style', get_stylesheet_uri());
    }
    add_action( 'wp_enqueue_scripts', 'your_scripts' );
    

    and putting this <?php wp_head(); ?>in your header.php before </head> in your head section, wordpress will ensure the style.css loaded properly.

    评论

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)