Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!---Plugin Development Basic to Advance ------->
- 1. Latest jQuery Calling:
- function owl_carousel_latest_jquery(){
- wp_enqueue_script('jquery');
- }
- add_action('init','owl_carousel_latest_jquery');
- 2. Jquery Plugin (Css and Jquery calling)
- 2.1 //set-up plugin css and JS
- define('OWL_CAROUSEL_DEV(u can use any name )', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' );
- 2.2 js calling
- //Carousel Jquery calling
- wp_enqueue_script('owl-carousel-main-jquery(u can use any name )', OWL_CAROUSEL_DEV(this name from Define functions ).'js/owl.carousel.min.js', array('jquery'));
- 2.3 css Calling
- //carousel css calling
- wp_enqueue_style('owl-carousel-css(u can use any name )', OWL_CAROUSEL_DEV(this name from Define functions ).'css/owl.carousel.css');
- 2.4 Js Active Hook
- function function_name (){?>
- //active code goes here
- <script type="text/javascript">
- jQuery(document).ready(function() {
- jQuery("#owl-demo").owlCarousel({
- autoPlay: 5000,
- items : 6,
- itemsDesktop : [1199,6],
- itemsDesktopSmall : [979,4]
- });
- });
- </script>
- <?php
- }
- add_action('where we need to load the plugins', 'you function name here'); like: add_action('wp_head', 'owl_carousel_active_hook');
- 3. Add custom post type, query and category etc. step by step
- 4. creating plugins admin menu page option :
- 4.1: add_menu_page():
- function owl_carouse_options_setting(){
- add_menu_page( 'owl-carousel', 'owl-carousel-option', 'manage_options','owl_carousel','owl_carouse_options_setting','',30);//add_menu_page('page-title(add you page title)','menu-title(it will show in your wordpress menu)','capability(user role who can change the option)','fucnction name(which function belongs to you menu page )','icon(you can set icon of the menu)','position(after which menu below or above it will show)',);
- }
- add_action('admin_menu','owl_carouse_options_setting');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement