Skip to content

Instantly share code, notes, and snippets.

@carlosonweb
Last active December 12, 2018 22:17
Show Gist options
  • Save carlosonweb/0bf42e6f350c28c0abecc324d4b19072 to your computer and use it in GitHub Desktop.
Save carlosonweb/0bf42e6f350c28c0abecc324d4b19072 to your computer and use it in GitHub Desktop.
Better BB Child Theme Helper Class
<?php
/**
* Helper class for child theme functions. This is a better version as it uses the child theme's version number.
*
* @class FLChildTheme
*/
final class FLChildTheme {
/**
* Enqueues scripts and styles.
*
* @return void
*/
static public function enqueue_scripts()
{
$ver = wp_get_theme()->get( 'Version' );
wp_enqueue_style( 'fl-child-theme', FL_CHILD_THEME_URL . '/style.css', array(), $ver );
// The code below is useful if you want to override the parent theme's JavaScript in the child theme.
//
// wp_dequeue_script( 'fl-automator' );
// wp_enqueue_script( 'fl-child-theme', FL_CHILD_THEME_URL . '/js/theme.js', array(), $ver );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment