Guest User

Untitled

a guest
Apr 26th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2. //Remove PHP tag before pasting into Functions file
  3.  
  4.  
  5. // Remove default Genesis Child Theme Stylesheet
  6. remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
  7. // Create function to append last modified file to stylesheet URL
  8. add_action( 'wp_enqueue_scripts', 'wd_genesis_child_stylesheet' );
  9. function wd_genesis_child_stylesheet() {
  10. $theme_name = defined('CHILD_THEME_NAME') && CHILD_THEME_NAME ? sanitize_title_with_dashes(CHILD_THEME_NAME) : 'child-theme'; // theme name for handle
  11. $stylesheet_uri = get_stylesheet_directory_uri() . '/style.css'; // stylesheet directory uri
  12. $stylesheet_dir = get_stylesheet_directory() . '/style.css'; // stylesheet directory
  13. $last_modified = date ( "njYHi", filemtime( $stylesheet_dir ) ); // last modification date for stylesheet
  14. // Enqueue the modified stylesheet with datestamp
  15. wp_enqueue_style( $theme_name, $stylesheet_uri, array(), $last_modified );
  16. }
Add Comment
Please, Sign In to add comment