Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Example Shortcode and Globally Enqueued Stylesheet
- *
- */
- // Our Shortcode function
- function hiroy_shortcode($content = null)
- {
- // Enqueue the stylesheet now
- wp_enqueue_style( 'hiroy-css');
- $content = '<h2>Hi Roy!</h2>';
- return $content;
- }
- // Our Shortcode Action
- add_shortcode('hiroy', 'hiroy_shortcode');
- // Register the Stylesheet so it's ready to go.
- function hiroy_enqueue_scripts() {
- wp_register_style( 'hiroy-css', 'hiroy.css', 'parent-stylesheet', '1.0', all );
- }
- // Enqueue Stylesheet Action
- add_action( 'wp_enqueue_scripts', 'hiroy_enqueue_scripts' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement