admin管理员组

文章数量:1332395

I have been trying to get the same code I have on my old server to work on my new server. This is the code I have thus far:

function enqueue_load_fa() {
wp_enqueue_style( 'load-fa', '.5.0/css/all.css' );
}

The issue I am having is that on my test site / it is not working but on my other one it is. See screenshot below: /DfNnwwV3ba3.png

Both servers have the same exact coding. I have tried 3 servers in all and only one of them has worked, with the same code. I am not understanding why it's not being accepted at all.

I have been trying to get the same code I have on my old server to work on my new server. This is the code I have thus far:

function enqueue_load_fa() {
wp_enqueue_style( 'load-fa', 'https://use.fontawesome/releases/v5.5.0/css/all.css' );
}

The issue I am having is that on my test site http://thedroidgamer.info/2018/11/25/hello-world/ it is not working but on my other one it is. See screenshot below: https://scrnshot.app/DfNnwwV3ba3.png

Both servers have the same exact coding. I have tried 3 servers in all and only one of them has worked, with the same code. I am not understanding why it's not being accepted at all.

Share Improve this question edited Nov 25, 2018 at 10:14 Jacob Peattie 44.1k10 gold badges50 silver badges64 bronze badges asked Nov 25, 2018 at 10:13 thedroidgamerthedroidgamer 111 silver badge3 bronze badges 3
  • That function isn't going to do anything unless you hook it with add_action(). Have you done that? – Jacob Peattie Commented Nov 25, 2018 at 10:14
  • I have this underneath that: add_action( 'wp_enqueue_style', 'enqueue_load_fa' ); add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); – thedroidgamer Commented Nov 25, 2018 at 10:20
  • Some thing to note that the css is not added to your webpage ..you can check that with developer tools on your web page ..means you have made some mistake in coding..post your complete code you might have made a typo some where – user145078 Commented Nov 25, 2018 at 10:49
Add a comment  | 

1 Answer 1

Reset to default 2

Try this,

function enqueue_load_fa() {
  wp_enqueue_style( 'load-fa', 'https://use.fontawesome/releases/v5.5.0/css/all.css' );
}

add_action( 'wp_enqueue_scripts', 'enqueue_load_fa');

本文标签: cssFont Awesome wpenqueuestyle