Skip to content

Instantly share code, notes, and snippets.

@wcodex
Created October 4, 2013 03:43
Show Gist options
  • Save wcodex/6820676 to your computer and use it in GitHub Desktop.
Save wcodex/6820676 to your computer and use it in GitHub Desktop.
Add stylesheet in WordPress in correct way
<?php
/*
You can add the stylesheet link tag directly on the page using the wp_head action
You can add the stylesheet link tag directly to the page anywhere.
You can use the wp_enqueue_scripts action to add a handle to the wp_enqueue_style.
Syntax
wp_enqueue_style( $handle, $src, $deps, $ver, $media );
*/
wp_register_style('New_style_id', get_template_directory_uri().'[New style URL', array(), '1', 'screen');
wp_enqueue_style('New_style_id');
/*
Using this we can add multiple stylesheets in WordPress themes
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment