Skip to content

Instantly share code, notes, and snippets.

@Edwardtonnn
Last active February 1, 2019 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Edwardtonnn/aaebe53f6f89b1ff13bc5dadcf5f33f3 to your computer and use it in GitHub Desktop.
Save Edwardtonnn/aaebe53f6f89b1ff13bc5dadcf5f33f3 to your computer and use it in GitHub Desktop.
Enqueu Style w Timestamp
<?php
function load_style(){
// How to load an external style
wp_enqueue_style('fonts-css', 'https://fonts.googleapis.com/css?family=Open+Sans|Valera+Round');
// How to load internal stylesheet
// Notice the get the time parameter near the end. This allows for clearly identifying when the css file has been loaded
// Only use get_the_time() when in development
wp_enqueue_style( 'main', get_stylesheet_uri(), ['font-css'], get_the_time());
}
// Note that when you add an action you say wp enqueue scripts NOT styles
add_action('wp_enqueue_scripts','load_style');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment