GOODLAYERS_PATH )); wp_enqueue_script('image-picker'); wp_deregister_script('confirm-dialog'); wp_register_script('confirm-dialog', GOODLAYERS_PATH.'/include/javascript/jquery.confirm.js', false, '1.0', true); wp_enqueue_script('confirm-dialog'); // register style and script when access to the "testimonial" post_type page }else if( $post_type == 'testimonial' || $post_type == 'personnal' ){ wp_enqueue_style('meta-css',GOODLAYERS_PATH.'/include/stylesheet/meta-css.css'); }else if( $post_type == 'price_table' ){ wp_enqueue_style('meta-css',GOODLAYERS_PATH.'/include/stylesheet/meta-css.css'); wp_deregister_script('price-table-script'); wp_register_script('price-table-script', GOODLAYERS_PATH.'/include/javascript/price-table-script.js', false, '1.0', true); wp_enqueue_script('price-table-script'); } } // register script in goodlayers panel function register_goodlayers_panel_scripts(){ wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-slider'); wp_deregister_script('cufon'); wp_register_script('cufon', GOODLAYERS_PATH.'/javascript/cufon.js', false, '1.0', false); wp_enqueue_script('cufon'); wp_deregister_script('gdl-panel'); wp_register_script('gdl-panel', GOODLAYERS_PATH.'/include/javascript/gdl-panel.js', false, '1.0', true); wp_localize_script( 'gdl-panel', 'URL', array('goodlayers' => GOODLAYERS_PATH, 'sample_text' => FONT_SAMPLE_TEXT )); wp_enqueue_script('gdl-panel'); wp_deregister_script('mini-color'); wp_register_script('mini-color', GOODLAYERS_PATH.'/include/javascript/jquery.miniColors.js', false, '1.0', true); wp_enqueue_script('mini-color'); wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_deregister_script('confirm-dialog'); wp_register_script('confirm-dialog', GOODLAYERS_PATH.'/include/javascript/jquery.confirm.js', false, '1.0', true); wp_enqueue_script('confirm-dialog'); } // register style in goodlayers panel function register_goodlayers_panel_styles(){ wp_enqueue_style('jquery-ui',GOODLAYERS_PATH.'/include/stylesheet/jquery-ui-1.8.16.custom.css'); wp_enqueue_style('gdl-panel',GOODLAYERS_PATH.'/include/stylesheet/gdl-panel.css'); wp_enqueue_style('mini-color',GOODLAYERS_PATH.'/include/stylesheet/jquery.miniColors.css'); wp_enqueue_style('thickbox'); wp_enqueue_style('confirm-dialog',GOODLAYERS_PATH.'/include/stylesheet/jquery.confirm.css'); } /* --------------------------------------------------------------------- * this section include the front-end script * --------------------------------------------------------------------- */ // Register all stylesheet function register_non_admin_styles(){ global $post; // Navigation Menu wp_enqueue_style('superfish',GOODLAYERS_PATH.'/stylesheet/superfish.css'); wp_enqueue_style('fancybox',GOODLAYERS_PATH.'/stylesheet/fancybox.css'); wp_enqueue_style('fancybox-thumbs',GOODLAYERS_PATH.'/stylesheet/jquery.fancybox-thumbs.css'); wp_enqueue_style('font-awesome',GOODLAYERS_PATH.'/stylesheet/font-awesome/font-awesome.css'); if( is_search() || is_archive() ){ wp_enqueue_style('flex-slider',GOODLAYERS_PATH.'/stylesheet/flexslider.css'); // Post post_type }else if( isset($post) && $post->post_type == 'post' || isset($post) && $post->post_type == 'portfolio' ){ // If using slider (flex slider) global $gdl_post_thumbnail; $gdl_post_thumbnail = get_post_meta($post->ID,'post-option-inside-thumbnail-types', true); if( $post->post_type == 'post' || $post->post_type == 'portfolio' ){ wp_enqueue_style('flex-slider',GOODLAYERS_PATH.'/stylesheet/flexslider.css'); } // Page post_type }else if( isset($post) && $post->post_type == 'page' ){ global $gdl_page_xml, $gdl_top_slider_type, $gdl_top_slider_xml; $gdl_page_xml = get_post_meta($post->ID,'page-option-item-xml', true); $gdl_top_slider_type = get_post_meta($post->ID,'page-option-top-slider-types', true); $gdl_top_slider_xml = get_post_meta($post->ID,'page-option-top-slider-xml', true); // If using nivo slider if( strpos($gdl_page_xml,'Nivo Slider') > -1 || $gdl_top_slider_type == 'Nivo Slider' ){ wp_enqueue_style('nivo-slider',GOODLAYERS_PATH.'/stylesheet/nivo-slider.css'); } // If using flex slider if( strpos($gdl_page_xml,'Flex Slider') > -1 || strpos($gdl_page_xml,'Carousel Slider') > -1 || strpos($gdl_page_xml, '') > -1 || strpos($gdl_page_xml, '') > -1 || $gdl_top_slider_type == 'Flex Slider' || $gdl_top_slider_type == 'Post Slider'){ wp_enqueue_style('flex-slider',GOODLAYERS_PATH.'/stylesheet/flexslider.css'); } // If using anything slider if( strpos($gdl_page_xml,'Anything Slider') > -1 || $gdl_top_slider_type == 'Anything Slider' ){ wp_enqueue_style('anythingSlider',GOODLAYERS_PATH.'/stylesheet/anythingslider.css'); } } } // Register all scripts function register_non_admin_scripts(){ global $post; global $gdl_is_responsive; global $goodlayers_element; global $gdl_top_sliding; // Navigation Menu wp_deregister_script('superfish'); wp_register_script('superfish', GOODLAYERS_PATH.'/javascript/superfish.js', false, '1.0', true); wp_enqueue_script('superfish'); wp_deregister_script('supersub'); wp_register_script('supersub', GOODLAYERS_PATH.'/javascript/supersub.js', false, '1.0', true); wp_enqueue_script('supersub'); wp_deregister_script('hover-intent'); wp_register_script('hover-intent', GOODLAYERS_PATH.'/javascript/hoverIntent.js', false, '1.0', true); wp_enqueue_script('hover-intent'); wp_deregister_script('easing'); wp_register_script('easing', GOODLAYERS_PATH.'/javascript/jquery.easing.js', false, '1.0', true); wp_enqueue_script('easing'); wp_deregister_script('fancybox'); wp_register_script('fancybox', GOODLAYERS_PATH.'/javascript/jquery.fancybox.js', false, '1.0', true); wp_localize_script( 'fancybox', 'ATTR', array( 'enable' => get_option( THEME_SHORT_NAME.'_enable_lightbox_thumbnail' ,'enable'), 'width' => get_option( THEME_SHORT_NAME.'_enable_lightbox_thumbnail_width' ,'80'), 'height' => get_option( THEME_SHORT_NAME.'_enable_lightbox_thumbnail_height' ,'45'), )); wp_enqueue_script('fancybox'); wp_deregister_script('fancybox-media'); wp_register_script('fancybox-media', GOODLAYERS_PATH.'/javascript/jquery.fancybox-media.js', false, '1.0', true); wp_enqueue_script('fancybox-media'); wp_deregister_script('fancybox-thumbs'); wp_register_script('fancybox-thumbs', GOODLAYERS_PATH.'/javascript/jquery.fancybox-thumbs.js', false, '1.0', true); wp_enqueue_script('fancybox-thumbs'); wp_deregister_script('gdl-scripts'); wp_register_script('gdl-scripts', GOODLAYERS_PATH.'/javascript/gdl-scripts.js', false, '1.0', true); wp_enqueue_script('gdl-scripts'); wp_deregister_script('fitvids'); wp_register_script('fitvids', GOODLAYERS_PATH.'/javascript/jquery.fitvids.js', false, '1.0', false); wp_enqueue_script('fitvids'); if( $gdl_top_sliding ){ wp_deregister_script('marquee'); wp_register_script('marquee', GOODLAYERS_PATH.'/javascript/marquee.js', false, '1.0', true); wp_enqueue_script('marquee'); } // Search and archive page if( is_search() || is_archive() ){ $flex_setting = get_gdl_slider_option_array($goodlayers_element['gdl_panel_flex_slider']); $flex_setting = array_merge($flex_setting, array('controlsContainer'=>'.flexslider')); wp_deregister_script('flex-slider'); wp_register_script('flex-slider', GOODLAYERS_PATH.'/javascript/jquery.flexslider.js', false, '1.0', true); wp_localize_script( 'flex-slider', 'FLEX', $flex_setting); wp_enqueue_script('flex-slider'); // Post post_type }else if( isset($post) && $post->post_type == 'post' || isset($post) && $post->post_type == 'portfolio' ){ // If using slider (flex slider) global $gdl_post_thumbnail; if( $post->post_type == 'post' || $post->post_type == 'portfolio' ){ $flex_setting = get_gdl_slider_option_array($goodlayers_element['gdl_panel_flex_slider']); $flex_setting = array_merge($flex_setting, array('controlsContainer'=>'.slider-wrapper')); wp_deregister_script('flex-slider'); wp_register_script('flex-slider', GOODLAYERS_PATH.'/javascript/jquery.flexslider.js', false, '1.0', true); wp_localize_script( 'flex-slider', 'FLEX', $flex_setting); wp_enqueue_script('flex-slider'); } // Page post_type }else if( isset($post) && $post->post_type == 'page' ){ global $gdl_page_xml, $gdl_top_slider_type, $gdl_top_slider_xml; // If using tesimonial slider if( strpos($gdl_page_xml,'Carousel Testimonial') > -1 ){ wp_deregister_script('jquery-cycle'); wp_register_script('jquery-cycle', GOODLAYERS_PATH.'/javascript/jquery.cycle.js', false, '1.0', true); wp_enqueue_script('jquery-cycle'); } // If selecting blog carousel if( strpos($gdl_page_xml,'Carousel') > -1 ){ wp_deregister_script('blog-carousel'); wp_register_script('blog-carousel', GOODLAYERS_PATH.'/javascript/blog-carousel.js', false, '1.0', true); wp_enqueue_script('blog-carousel'); } // If selecting portfolio carousel if( strpos($gdl_page_xml,'Carousel Portfolio') > -1 || strpos($gdl_page_xml,'Carousel Description Portfolio') > -1 ){ wp_deregister_script('portfolio-carousel'); wp_register_script('portfolio-carousel', GOODLAYERS_PATH.'/javascript/portfolio-carousel.js', false, '1.0', true); wp_enqueue_script('portfolio-carousel'); } // If using nivo slider if( strpos($gdl_page_xml,'Nivo Slider') > -1 || $gdl_top_slider_type == 'Nivo Slider' ){ $nivo_setting = get_gdl_slider_option_array($goodlayers_element['gdl_panel_nivo_slider']); wp_deregister_script('nivo-slider'); wp_register_script('nivo-slider', GOODLAYERS_PATH.'/javascript/jquery.nivo.slider.js', false, '1.0', true); wp_localize_script( 'nivo-slider', 'NIVO', $nivo_setting); wp_enqueue_script('nivo-slider'); } // If using flex slider if( strpos($gdl_page_xml, 'Flex Slider') > -1 || strpos($gdl_page_xml, 'Carousel Slider') > -1 || strpos($gdl_page_xml, '') > -1 || strpos($gdl_page_xml, '') > -1 || $gdl_top_slider_type == 'Flex Slider' || $gdl_top_slider_type == 'Post Slider'){ $flex_setting = get_gdl_slider_option_array($goodlayers_element['gdl_panel_flex_slider']); $flex_setting = array_merge($flex_setting, array('controlsContainer'=>'.flexslider')); wp_deregister_script('flex-slider'); wp_register_script('flex-slider', GOODLAYERS_PATH.'/javascript/jquery.flexslider.js', false, '1.0', true); wp_localize_script( 'flex-slider', 'FLEX', $flex_setting); wp_enqueue_script('flex-slider'); } // If using anything slider if( strpos($gdl_page_xml,'Anything Slider') > -1 || $gdl_top_slider_type == 'Anything Slider' ){ $anything_setting = get_gdl_slider_option_array($goodlayers_element['gdl_panel_anything_slider']); wp_deregister_script('anythingSlider'); wp_register_script('anythingSlider', GOODLAYERS_PATH.'/javascript/jquery.anythingslider.js', false, '1.0', true); wp_localize_script( 'anythingSlider', 'ANYTHING', $anything_setting); wp_enqueue_script('anythingSlider'); // If using video in anything slider if( strpos($gdl_page_xml,'Link to Video') > -1 || strpos($gdl_top_slider_xml,'Link to Video') > -1 ){ wp_deregister_script('anything-swfobject'); wp_register_script('anything-swfobject', GOODLAYERS_PATH.'/javascript/anything-swfobject.js', false, '1.0', true); wp_enqueue_script('anything-swfobject'); wp_deregister_script('anythingSlider-video'); wp_register_script('anythingSlider-video', GOODLAYERS_PATH.'/javascript/jquery.anythingslider.video.js', false, '1.0', true); wp_enqueue_script('anythingSlider-video'); } } // If using filterable plugin if( strpos($gdl_page_xml,'jQuery Filter Portfolio') > -1 ){ wp_deregister_script('filterable'); wp_register_script('filterable', GOODLAYERS_PATH.'/javascript/jquery.filterable.js', false, '1.0', true); wp_enqueue_script('filterable'); } // If use contact-form if( strpos($gdl_page_xml,'') > -1 ){ wp_deregister_script('contact-form'); wp_register_script('contact-form', GOODLAYERS_PATH.'/javascript/gdl-contactform.js', false, '1.0', true); wp_localize_script( 'contact-form', 'MyAjax', array( 'ajaxurl' => AJAX_URL ) ); wp_enqueue_script('contact-form'); } } // Comment Script if(is_singular() && comments_open() && get_option('thread_comments')){ wp_enqueue_script( 'comment-reply' ); } } ?>