Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function webriti_scripts()
- {
- $quality_pro_options=theme_data_setup();
- $current_options = wp_parse_args( get_option( 'quality_pro_options', array() ), $quality_pro_options );
- $class=$current_options['style_sheet'];
- wp_enqueue_style('bootstrap', WEBRITI_TEMPLATE_DIR_URI . '/css/bootstrap.css');
- wp_enqueue_style('quality-style', get_stylesheet_uri() );
- if($current_options['link_color_enable'] != true)
- {
- wp_enqueue_style('default', WEBRITI_TEMPLATE_DIR_URI . '/css/'.$class);
- }
- wp_enqueue_style('theme-menu', WEBRITI_TEMPLATE_DIR_URI . '/css/theme-menu.css');
- wp_enqueue_style('media-responsive', WEBRITI_TEMPLATE_DIR_URI . '/css/media-responsive.css');
- wp_enqueue_style('font-awesome-min', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css');
- wp_enqueue_style('layout', WEBRITI_TEMPLATE_DIR_URI . '/css/switcher/layout-responsive.css');
- wp_enqueue_script('menu', WEBRITI_TEMPLATE_DIR_URI .'/js/menu/menu.js',array('jquery'));
- wp_enqueue_script('bootstrap', WEBRITI_TEMPLATE_DIR_URI .'/js/bootstrap.min.js');
- wp_enqueue_script('custom-js', WEBRITI_TEMPLATE_DIR_URI .'/js/custom.js');
- wp_enqueue_style('lightbox', WEBRITI_TEMPLATE_DIR_URI . '/css/lightbox.css');
- //Home Page And Home Page Template js and css
- if(is_home() || is_page_template('template-frontpage.php')) {
- wp_enqueue_style('flexslider', WEBRITI_TEMPLATE_DIR_URI . '/css/flexslider/flexslider.css');
- wp_enqueue_script('flexslider', WEBRITI_TEMPLATE_DIR_URI .'/js/flexslider/jquery.flexslider.js');
- wp_enqueue_script('carouFredSel', WEBRITI_TEMPLATE_DIR_URI .'/js/caroufredsel/jquery.carouFredSel-6.2.1-packed.js');
- wp_enqueue_script('lightbox', WEBRITI_TEMPLATE_DIR_URI .'/js/lightbox/lightbox-2.6.min.js');
- }
- if(is_page_template('template-frontpage-parallax.php'))
- {
- wp_enqueue_style('flexslider', WEBRITI_TEMPLATE_DIR_URI . '/css/flexslider/flexslider.css');
- wp_enqueue_script('flexslider', WEBRITI_TEMPLATE_DIR_URI .'/js/flexslider/jquery.flexslider.js');
- wp_enqueue_script('lightbox', WEBRITI_TEMPLATE_DIR_URI .'/js/lightbox/lightbox-2.6.min.js');
- wp_enqueue_style('style-animate', WEBRITI_TEMPLATE_DIR_URI . '/css/animate.css');
- wp_enqueue_style('style-parallax', WEBRITI_TEMPLATE_DIR_URI . '/css/style-parallax.css');
- wp_enqueue_script('caroufredsel-element', WEBRITI_TEMPLATE_DIR_URI .'/js/caroufredsel/caroufredsel-element.js');
- wp_enqueue_script('carouFredSel', WEBRITI_TEMPLATE_DIR_URI .'/js/caroufredsel/jquery.carouFredSel-6.2.1-packed.js');
- wp_enqueue_script('script-scroll-sticky', WEBRITI_TEMPLATE_DIR_URI .'/js/scroll/jquery.sticky.js');
- wp_enqueue_script('script-scroll-parallax', WEBRITI_TEMPLATE_DIR_URI .'/js/scroll/parallax.js',array(),'0.1',true);
- }
- // Portfolio js and css
- if(is_page_template('portfolio-2-column.php') || is_page_template('portfolio-3-column.php') || is_page_template('portfolio-4-column.php'))
- {
- wp_enqueue_style('lightbox', WEBRITI_TEMPLATE_DIR_URI . '/css/lightbox.css');
- wp_enqueue_script('lightbox', WEBRITI_TEMPLATE_DIR_URI .'/js/lightbox/lightbox-2.6.min.js');
- }
- if(is_page_template('single-quality_portfolio.php') || 'quality_portfolio' == get_post_type())
- {
- wp_enqueue_style('lightbox', WEBRITI_TEMPLATE_DIR_URI . '/css/lightbox.css');
- wp_enqueue_script('lightbox', WEBRITI_TEMPLATE_DIR_URI .'/js/lightbox/lightbox-2.6.min.js');
- }
- }
- add_action('wp_enqueue_scripts', 'webriti_scripts');
- if ( is_singular() ){ wp_enqueue_script( "comment-reply" ); }
- function webriti_custom_enqueue_css()
- { global $pagenow;
- if ( in_array( $pagenow, array( 'post.php', 'post-new.php', 'page-new.php', 'page.php' ) ) ) {
- wp_enqueue_style('meta-box-css', WEBRITI_TEMPLATE_DIR_URI . '/css/meta-box.css');
- }
- }
- add_action( 'admin_print_styles', 'webriti_custom_enqueue_css', 10 );
- function quality_shortcode_detect() {
- global $wp_query;
- $posts = $wp_query->posts;
- $pattern = get_shortcode_regex();
- foreach ($posts as $post){
- if ( preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches ) && array_key_exists( 2, $matches ) && in_array( 'button', $matches[2] ) || in_array( 'row', $matches[2] ) || in_array( 'accordian', $matches[2] ) || in_array( 'tabgroup', $matches[2]) || in_array( 'tabs', $matches[2] ) || in_array( 'alert', $matches[2] ) || in_array( 'dropcap', $matches[2] ) || in_array( 'gridsystemlayout', $matches[2] ) || in_array( 'tooltip', $matches[2] ) || in_array( 'heading', $matches[2] )) {
- wp_enqueue_script('bootstrap', WEBRITI_TEMPLATE_DIR_URI .'/js/bootstrap.min.js',array('jquery'));
- wp_enqueue_script('accordion-tab', WEBRITI_TEMPLATE_DIR_URI .'/js/accordion-tab.js');
- wp_enqueue_script('collapse', WEBRITI_TEMPLATE_DIR_URI .'/js/collapse.js');
- break;
- }
- }
- }
- add_action( 'wp', 'quality_shortcode_detect' );
- add_action( 'admin_enqueue_scripts', 'admin_enqueue_script_function' );
- function admin_enqueue_script_function()
- {
- wp_enqueue_style( 'jquery-ui' );
- wp_enqueue_style('quality-drag-drop',WEBRITI_TEMPLATE_DIR_URI.'/css/drag-drop.css');
- wp_enqueue_script('quality-jquery-ui' , WEBRITI_TEMPLATE_DIR_URI.'/js/jquery-ui.js');
- wp_enqueue_script('quality-jquery-ui-drag' , WEBRITI_TEMPLATE_DIR_URI.'/js/layout-drag-drop.js');
- }
- add_action('wp_head','head_enqueue_custom_css');
- function head_enqueue_custom_css()
- {
- require_once( WEBRITI_THEME_FUNCTIONS_PATH .'/scripts/custom_style.php');
- $quality_pro_options=theme_data_setup();
- $current_options = wp_parse_args( get_option( 'quality_pro_options', array() ), $quality_pro_options );
- if($current_options['webrit_custom_css']!='') { ?>
- <style>
- <?php echo $current_options['webrit_custom_css']; ?>
- </style>
- <?php
- }
- }
- // footer custom script
- function footer_custom_script()
- {
- $quality_pro_options=theme_data_setup();
- $current_options = wp_parse_args( get_option( 'quality_pro_options', array() ), $quality_pro_options);
- if($current_options['link_color_enable'] == true) {
- custom_light();
- }
- }
- add_action('wp_footer','footer_custom_script');
- ?>
Add Comment
Please, Sign In to add comment