Register styles in main plugin

Enqueue styles only if needed
This commit is contained in:
Justin Foell
2014-11-04 21:09:12 -06:00
parent 18d8897ee9
commit 353ee5ecb0
5 changed files with 15 additions and 27 deletions
+7
View File
@@ -19,6 +19,8 @@ class WPStrava {
if ( is_admin() ) {
$this->settings->hook();
} else {
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
}
// Register StravaLatestRidesWidget widget
@@ -66,4 +68,9 @@ class WPStrava {
return $this->rides;
}
public function register_scripts() {
// Register a personalized stylesheet
wp_register_style( 'wp-strava-style', WPSTRAVA_PLUGIN_URL . 'css/wp-strava.css' );
}
}