-
Notifications
You must be signed in to change notification settings - Fork 0
Adding Script Dependencies
Jim Reevior edited this page Aug 14, 2018
·
1 revision
The main JavaScript file for a Responsive Framework theme will always be loaded automatically by the framework. If there are scripts that must be loaded before this script (jQuery libraries, for example), they can be added as dependencies.
<?php
/**
* Add Waypoints as a dependency for the theme's JavaScript.
*
* @param array $dependencies Responsive script dependencies.
*
* @return array Responsive script dependencies.
*/
function mytheme_r_script_dependencies( $dependencies ) {
$dependencies[] = 'waypoints';
return $dependencies
}
add_filter( 'r_script_dependencies', 'mytheme_r_script_dependencies' );
Note: You need to enqueue the scripts yourself in the wp_enqueue_scripts
action hook.
Get started
Configuration
Build child themes
- Customizing CSS in a child theme
- Overriding templates in a child theme
- Code patterns
- Code reviews
- Pulling in Foundation Updates
- Merging and Creating a Pull Request
Sass
Javascript
PHP
- Coding Standards
- PHP Constants
- Temp PHP Code Patterns
- PHP Snippets
- How to Use Hooks
- Action Hooks
- Using Action Hooks To Output Markup
- Filter Hooks
Shortcodes
Templates
GitHub
Tasks
Contribute to the framework
- Framework Development and Release Workflows
- Documentation Template
- Testing your changes
- Creating a new release
- Migration Guide
- Needs Documentation
Code Examples
- Adding Content Container Classes
- Adding News Templates
- Adding Script Dependencies
- Changing Available Layouts and Default Layout
- Displaying a Fancy Gallery
- Loading a Custom Build of Modernizr
- Loading Modernizr in the Footer
- Using Action Hooks To Output Markup
- Understanding get_template_part
BU Developer Resources