Zul K Zul K - 3 months ago 5x
CSS Question

How i can load a CSS file in my wordpress theme head tag

I am new to WordPress. I have a link and I want to add in head tag of my WordPress theme.

<link rel="stylesheet" href="http://pashtofonts.com/api/pashto.css" />

Please can someone help me in an easy way to add this CSS link into my WordPress theme.

I had seen other examples, but couldn't understand.


The best way to do this would be to enqueue the script from inside your functions file.

Simply add the line below to the bottom of the functions.php file inside your theme directory.

function my_style_sheets() {
    wp_enqueue_style( 'pashto-font-css', 'http://pashtofonts.com/api/pashto.css' );
add_action( 'wp_enqueue_scripts', 'my_style_sheets' );

This will ensure that your Pashto stylesheet gets loaded inside the HTML head of your webpage along with all of the other stylesheets your website makes use of.