Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-fix Script and Style Handles #21

Open
rcass opened this issue Jun 22, 2018 · 0 comments
Open

Pre-fix Script and Style Handles #21

rcass opened this issue Jun 22, 2018 · 0 comments

Comments

@rcass
Copy link

rcass commented Jun 22, 2018

In functions.php, remember to pre-fix the handles to avoid naming collisions (from other plugins etc)

wp_enqueue_style( 'custom-google-fonts', 'https://fonts.googleapis.com/css?family=Oswald', false );
wp_enqueue_style( 'font-awesome-cdn', 'https://use.fontawesome.com/releases/v5.0.6/css/all.css', array(), '5.0.6' );
wp_enqueue_style( 'wav-starter-style', get_stylesheet_uri() );
wp_enqueue_script( 'wav-starter-skip-link-focus-fix', get_template_directory_uri() . '/build/js/skip-link-focus-fix.min.js', array(), '20130115', true );
wp_enqueue_script('flickity', 'https://npmcdn.com/flickity@2/dist/flickity.pkgd.js', true);
wp_enqueue_style( 'flickity-css', 'https://npmcdn.com/flickity@2/dist/flickity.css', false );
wp_enqueue_script('smoothscroll_script', get_template_directory_uri() . '/build/js/smoothscroll.min.js', array('jquery'),'20180615', true);
wp_enqueue_script( 'carousel', get_template_directory_uri() . '/build/js/carousel.min.js', array('jquery'), '20180613', true );
wp_enqueue_script( 'front-page-tab', get_template_directory_uri() . '/build/js/front-page-tab.min.js', array('jquery'), '20180615', true );
wp_enqueue_script( 'activity', get_template_directory_uri() . '/build/js/activity.min.js', array('jquery'), '20180616', true );
wp_enqueue_script( 'hamburger-script', get_template_directory_uri() . '/build/js/hamburger.min.js', array('jquery'), '20180618', true );
wp_enqueue_script( 'submission', get_template_directory_uri() . '/build/js/submission.min.js', array('jquery'), '20180619', true );
wp_enqueue_script( 'header-script', get_template_directory_uri() . '/build/js/header.min.js', array('jquery'), '20180621', true );
wp_enqueue_script( 'archive-activity', get_template_directory_uri() . '/build/js/archive-activity.min.js', array('jquery'), '20180622', true );

So from above things like wav-starter-style are GOOD ✅
but carousel is BAD ❌ since it is TOO generic

Solution: Just add the prefix wav- to the handles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant