Last active
November 17, 2017 14:21
-
-
Save obiPlabon/62575b164976fb7e0c53edff433a1bfe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Enqueue assets (js/css) | |
| */ | |
| function prefix_enqueue_assets() { | |
| wp_enqueue_script( | |
| 'prefix-script', | |
| get_template_directory_uri() . '/assets/js/scripts.js', | |
| array('jquery'), | |
| null, | |
| true | |
| ); | |
| $localize_data = array( | |
| /** | |
| * prefix_get_option(), we wrote this function before | |
| * (check wpian-help-redux.php) as it seems more convenient | |
| * than the old style | |
| */ | |
| 'service_content_layout' => esc_js( prefix_get_option( 'p_service_content_layout' ) ), | |
| ); | |
| wp_localize_script( | |
| 'prefix-script', // This handle must be the same hand we used to enqueue scripts.js | |
| 'prefix_l10n', | |
| $localize_data | |
| ); | |
| } | |
| add_action( 'wp_enqueue_scripts', 'prefix_enqueue_assets' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function(){ | |
| jQuery('#service_owl_carousel').owlCarousel({ | |
| autoplay: true, | |
| dots: false, | |
| responsive: { | |
| 0: { | |
| items:1, | |
| nav:true | |
| }, | |
| 767: { | |
| items:2, | |
| nav:true | |
| }, | |
| 991: { | |
| items: prefix_l10n.service_content_layout | |
| nav: true | |
| } | |
| } | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Cleaner way to access redux framework based theme options | |
| */ | |
| function prefix_get_option( $option_name, $default = '' ) { | |
| global $prefix_options_var_name; | |
| return isset( $prefix_options_var_name[$option_name] ) ? $prefix_options_var_name[$option_name] : $default; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment