function site_scripts() { global $wp_styles; // Call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way // Load What-Input files in footer wp_enqueue_script('what-input', get_template_directory_uri() . '/vendor/what-input/what-input.min.js', array(), '', true); // Adding Foundation scripts file in the footer wp_enqueue_script('foundation-js', get_template_directory_uri() . '/assets/js/foundation.min.js', array('jquery'), '6.0', true); wp_enqueue_script('sticky-js', get_template_directory_uri() . '/assets/js/jquery.sticky.js', array('jquery'), '6.0', true); // Adding Owl Carousel script file in the footer wp_enqueue_script('owl-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.js', array('jquery'), '', true); //Google MAps API if (is_page('about-us') || is_page('contact-us')) { wp_enqueue_script('maps-js', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBTfVURGZR7YFppqYW9LVpRCk0xmup0YSg', array('jquery'), '', true); wp_enqueue_script('custom-maps-js', get_template_directory_uri() . '/assets/js/mapScripts.js', array('jquery'), '', true); } if (is_page('blood-testing')) { wp_enqueue_script('maps-js', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBTfVURGZR7YFppqYW9LVpRCk0xmup0YSg', array('jquery'), '', true); wp_enqueue_script('cluster-maps-js', get_template_directory_uri() . '/assets/js/markerclusterer.js', array('jquery'), '', true); wp_enqueue_script('blood-testing-maps-js', get_template_directory_uri() . '/assets/js/bloodMapScripts.js', array('jquery'), '', true); } if (is_page('skype-call-test-page')) { wp_enqueue_script('skype-js', 'http://www.skypeassets.com/i/scom/js/skype-uri.js', array('jquery'), '', true); //wp_enqueue_script( 'skype.js', get_template_directory_uri() . '/assets/js/skype.js', array( 'jquery' ), '', true ); } //infinite scroll wp_enqueue_script('infinite-scroll-js', '//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js', array('jquery'), '', true); //Masonry Grid wp_enqueue_script('masonry-js', '//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js', array('jquery'), '', true); //Images Loaded wp_enqueue_script('images-loaded-js', '//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js', array('jquery'), '', true); //jSignature.js wp_enqueue_script('jSignature.js', get_template_directory_uri() . '/assets/js/jSignature.min.noconflict.js', array('jquery'), '', true); if (is_page_template('template-video-chat.php') || is_singular('consult')) { //simpleWebRTC //wp_enqueue_script( 'simpleWebRTC.js', 'https://simplewebrtc.com/latest-v2.js', array( 'jquery' ), '', true ); //wp_enqueue_script( 'video.js', get_template_directory_uri() . '/assets/js/video-scripts.js', array( 'jquery' ), '', true ); } //Video.js //wp_enqueue_script( 'video.js', 'https://vjs.zencdn.net/5.5.3/video.js', array( 'jquery' ), '', true ); //iCheck.js //wp_enqueue_script( 'iCheck.js', get_template_directory_uri() . '/assets/js/icheck.min.js', array( 'jquery' ), '', true ); //EnrollForm.js wp_enqueue_script('enrollForm.js', get_template_directory_uri() . '/assets/js/enroll-form.js', array('jquery'), '', true); //Stellar.js wp_enqueue_script('stellar.js', get_template_directory_uri() . '/assets/js/jquery.stellar.js', array('jquery'), '', true); //countTo.JS wp_enqueue_script('countUp.js', get_template_directory_uri() . '/assets/js/jquery.countTo.js', array('jquery'), '', true); // Adding Waypoints script file in the footer wp_enqueue_script('waypoints', get_template_directory_uri() . '/assets/js/jquery.waypoints.js', array('jquery'), '', true); wp_enqueue_script('waypoints-inview', get_template_directory_uri() . '/assets/js/inview.js', array('jquery'), '', true); // Adding scripts file in the footer wp_enqueue_script('site-js', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), '', true); // Register main stylesheet wp_enqueue_style('site-css', get_template_directory_uri() . '/assets/css/style.css', array(), '', 'all'); // Comment reply script for threaded comments if (is_singular() and comments_open() and get_option('thread_comments') == 1) { wp_enqueue_script('comment-reply'); } }
function mighty_content_width() { if (is_page_template('template-homepage.php') || is_page_template('template-full-width.php') || is_singular('portfolio') || is_attachment()) { global $content_width; $content_width = 980; } }
/** * Adjust $content_width it depending on the temaplte used */ function sugarspice_content_width() { global $content_width; if (!is_active_sidebar('sidebar-1') || is_page_template('full-width-page.php')) { $content_width = 940; } }
function penscratch_content_width() { global $content_width; if (is_page_template('fullwidth-page.php') && is_active_sidebar('sidebar-1')) { $content_width = 937; } }
/** * Adjust content_width value for full width template. */ function first_content_width() { if (is_page_template('page_fullwidth.php')) { global $content_width; $content_width = 1000; } }
function ce_map_shortcode($atts) { $address = 'New York'; if (is_page_template("page-post-ad.php") && !isset($_GET['id']) && is_user_logged_in()) { global $user_ID; $address = get_user_meta($user_ID, 'et_address', true); } $default = array('w' => '100%', 'h' => '300px', 'lat' => '', 'lng' => '', 'zoom' => 20, 'address' => $address, 'is_single' => 0); $atts = wp_parse_args($atts, $default); extract($atts); $mininfy = get_theme_mod('ce_minify', 0); // if(!$mininfy) { wp_enqueue_script('ce-map-shorcode'); wp_localize_script('ce-map-shorcode', 'map_short_code', $atts); // } // if (!is_page_template('page-post-ad.php')) { // wp_enqueue_script('gmap'); // wp_enqueue_script('marker_cluster', plugin_dir_url(__FILE__) . '/js/marker-cluster.js', array( // 'gmap' // ) , '1.0'); // wp_enqueue_style('map-style', plugin_dir_url(__FILE__) . '/css/map-front.css', true, CE_MAP_VER); // } $html = '<div id="map-shortcode" class="map-shortcode" style="width : ' . $w . '; heigth: ' . $h . '; margin-top:0px;">'; $html .= '</div>'; return $html; }
function _base_scripts() { global $post; // remove version add_filter('script_loader_src', 'remove_src_version'); // global styles wp_enqueue_style('bootstrap-min', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), ''); wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(), ''); if (class_exists('bbPress')) { if (is_bbpress()) { wp_enqueue_style('bbpress-custom', get_template_directory_uri() . '/assets/css/bbpress.css', array(), ''); } } wp_enqueue_style('custom', get_template_directory_uri() . '/assets/css/customs.css', array(), ''); wp_enqueue_style('custom-style', get_template_directory_uri() . '/style.css', array(), ''); // global scripts wp_enqueue_script('jquery'); wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), '', true); if (is_single() && get_post_type() == 'course_unit') { wp_enqueue_script('froogaloop2', get_template_directory_uri() . '/assets/js/froogaloop2.min.js', array(), '', true); } if (is_page_template('page-templates/tpl-webinars.php')) { wp_enqueue_style('fancybox', get_template_directory_uri() . '/assets/lib/fancybox/jquery.fancybox.css', array(), ''); wp_enqueue_script('fancybox', get_template_directory_uri() . '/assets/lib/fancybox/jquery.fancybox.pack.js', array(), '', true); wp_enqueue_script('fancybox-media', get_template_directory_uri() . '/assets/lib/fancybox/helpers/jquery.fancybox-media.js', array(), '', true); } if (has_shortcode($post->post_content, 'iard_table')) { wp_enqueue_script('angular', get_template_directory_uri() . '/assets/js/angular.min.js', array(), '', true); wp_enqueue_script('angular-sanitize', get_template_directory_uri() . '/assets/js/angular-sanitize.js', array(), '', true); wp_enqueue_script('table-app', get_template_directory_uri() . '/assets/js/tables.js', array(), '', true); } wp_enqueue_script('main', get_template_directory_uri() . '/assets/js/main.js', array(), '', true); }
function zero_scripts() { if (!is_admin()) { //Call Modernizr wp_register_script('modernizr', get_template_directory_uri() . '/js/libs/modernizr.dev.js', array(), null, false); wp_enqueue_script('modernizr'); //Call JQuery wp_deregister_script('jquery'); wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', '', '', true); wp_enqueue_script('jquery'); if (is_front_page() || is_page_template('new-story-page.php')) { wp_register_script('slider_js', get_template_directory_uri() . '/js/libs/slider.min.js', array('jquery'), null, true); wp_enqueue_script('slider_js'); } if (is_page(11) || is_child(11)) { wp_register_script('gallery_js', get_template_directory_uri() . '/js/libs/gallery.js', array('jquery'), null, true); wp_enqueue_script('gallery_js'); } //Call Framework js file wp_register_script('main_js', get_template_directory_uri() . '/js/build/concat.js', array('jquery'), '', true); wp_enqueue_script('main_js'); } // Setting the site URL as a global variable // You can use it to access the template URL in the mainJSfile $site_parameters = array('site_url' => get_site_url(), 'theme_directory' => get_template_directory_uri()); wp_localize_script('main_js', 'SiteParameters', $site_parameters); }
function my_class_names($classes) { if (is_page_template('page-home.php')) { $classes[] = 'p-index'; } if (is_page_template('page-gridtext.php')) { $classes[] = 'p-gridtext'; $classes[] = '_crumbs'; } if (is_page_template('page-management.php')) { $classes[] = 'p-management'; $classes[] = '_crumbs'; } if (is_page_template('page-product.php')) { $classes[] = 'p-product'; $classes[] = '_crumbs'; } if (is_page_template('page-sport.php')) { $classes[] = 'p-sport'; $classes[] = '_crumbs'; } if (is_page_template('page-volunteer.php')) { $classes[] = 'p-volunteer'; $classes[] = '_crumbs'; } return $classes; }
function clea_atout_c_tests_style() { global $post; if (is_page_template('page/ac-front-page-template.php')) { wp_enqueue_style('flexslider', get_template_directory_uri() . '/css/flexslider.css', array('25px')); } }
/** * Enqueues scripts and styles for front-end. * */ function shootingstar_scripts_styles() { global $wp_styles, $wp_scripts; // Adds JavaScript if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } if (get_theme_mod('shootingstar_infinite_scroll') != 'Disable') { if (is_home() || is_archive() || is_search()) { wp_enqueue_script('shootingstar-infinitescroll', get_template_directory_uri() . '/js/infinitescroll.min.js', array('jquery'), '2.0.2', true); wp_enqueue_script('shootingstar-infinitescroll-settings', get_template_directory_uri() . '/js/infinitescroll-settings.js', array(), '1.0', true); $shootingstar_site_parameters = array('theme_directory' => get_template_directory_uri(), 'message_load' => __('<p>Loading...</p>', 'shootingstar'), 'message_end' => __('<p>No further posts.</p>', 'shootingstar')); wp_localize_script('shootingstar-infinitescroll-settings', 'SiteParameters', $shootingstar_site_parameters); } } wp_enqueue_script('shootingstar-placeholders', get_template_directory_uri() . '/js/placeholders.js', array('jquery'), '2.0.8', true); if (get_theme_mod('shootingstar_display_scroll_top') != 'Hide') { wp_enqueue_script('shootingstar-scroll-to-top', get_template_directory_uri() . '/js/scroll-to-top.js', array('jquery'), '1.0', true); } if (get_theme_mod('shootingstar_fixed_menu') != 'Disable' && !is_page_template('template-landing-page.php')) { wp_enqueue_script('shootingstar-menubox', get_template_directory_uri() . '/js/menubox.js', array(), '1.0', true); } wp_enqueue_script('shootingstar-selectnav', get_template_directory_uri() . '/js/selectnav.js', array(), '0.1', true); wp_enqueue_script('shootingstar-responsive', get_template_directory_uri() . '/js/responsive.js', array(), '1.0', true); wp_enqueue_script('shootingstar-html5-ie', get_template_directory_uri() . '/js/html5.min.js', array(), '3.7.2', false); $wp_scripts->add_data('shootingstar-html5-ie', 'conditional', 'lt IE 9'); // Adds CSS wp_enqueue_style('shootingstar-elegantfont', get_template_directory_uri() . '/css/elegantfont.css'); wp_enqueue_style('shootingstar-google-font-default', '//fonts.googleapis.com/css?family=PT+Sans&subset=latin,latin-ext'); if (class_exists('woocommerce')) { wp_enqueue_style('shootingstar-woocommerce-custom', get_template_directory_uri() . '/css/woocommerce-custom.css'); } }
/** * Set portfolio page template classes */ public function set_portfolio_page_template_classes($classes) { if (is_page_template('portfolio-one-column.php') || is_page_template('portfolio-two-column.php') || is_page_template('portfolio-three-column.php') || is_page_template('portfolio-four-column.php') || is_page_template('portfolio-five-column.php') || is_page_template('portfolio-six-column.php') || is_page_template('portfolio-one-column-text.php') || is_page_template('portfolio-two-column-text.php') || is_page_template('portfolio-three-column-text.php') || is_page_template('portfolio-four-column-text.php') || is_page_template('portfolio-five-column-text.php') || is_page_template('portfolio-six-column-text.php') || is_page_template('portfolio-grid.php')) { $classes[] = avada_get_portfolio_classes(Avada::c_pageID()); } return $classes; }
function blackoot_content_width() { global $content_width; if (is_page_template('page-full-width.php')) { $content_width = 920; } }
function featureText() { if (is_front_page()) { the_field('feature_text'); } elseif (is_home() || is_single()) { _e('Rock Theme Official Blog'); } elseif (is_archive()) { _e('Rock Theme Official Blog'); _e('<br>'); single_term_title('Browsing: '); if (is_month()) { $monthNum = get_query_var('monthnum'); $month = date('F', mktime(0, 0, 0, $monthNum)); $year = get_query_var('year'); echo 'Posts from ' . $month . ' ' . $year; } } elseif (is_page_template('page-news.php') || is_page_template('page-about.php') || is_page_template('page-contact.php')) { bloginfo('name'); _e('<br>'); the_title(); } elseif (is_404()) { _e('Whoops, were a little lost.'); } elseif (is_search()) { _e('Rock Theme Official Blog'); _e('<br>'); printf('Search results for: %s', get_search_query()); } }
/** * Add Bootstrap classes to the main-content-area wrapper. */ function activello_main_content_bootstrap_classes() { if (is_page_template('page-fullwidth.php')) { return 'col-sm-12 col-md-12'; } return 'col-sm-12 col-md-8'; }
function Radix_content_width() { if (is_page_template('page-fullwidth.php') || is_page_template('front-page.php')) { global $content_width; $content_width = 1170; } }
function colabsthemes_script_and_style() { // Styles wp_enqueue_style('framework', get_template_directory_uri() . '/includes/css/framework.css'); wp_enqueue_style('style', get_stylesheet_directory_uri() . '/style.css', array('framework')); wp_enqueue_style('mmenu-style', get_stylesheet_directory_uri() . '/includes/css/jquery.mmenu.css'); // Scripts wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-slider'); // Only load fancybox on single property if ('property' == get_post_type()) { wp_enqueue_script('fancybox', get_template_directory_uri() . '/includes/js/fancybox/jquery.fancybox-1.3.4.pack.js', array('jquery'), '', true); wp_enqueue_style('fancybox', get_template_directory_uri() . '/includes/js/fancybox/jquery.fancybox-1.3.4.css'); } wp_enqueue_script('plugins', trailingslashit(get_template_directory_uri()) . 'includes/js/plugins.js', array('jquery'), '', true); wp_enqueue_script('scripts', trailingslashit(get_template_directory_uri()) . 'includes/js/scripts.js', array('jquery'), '', true); /* Script for threaded comments. */ if (is_singular() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } wp_localize_script('scripts', 'translationstring', array('nomorepost' => __('No More Post', 'colabsthemes'))); // Translatable string for form builder $rent_term_obj = get_term_by('slug', 'rent', COLABS_TAX_STATUS); $term_id = isset($rent_term_obj->term_id) ? $rent_term_obj->term_id : ''; $formbuilder_string = array('media_upload' => array('title' => __('Upload', 'colabsthemes'), 'button_text' => __('Use this file', 'colabsthemes')), 'gallery_upload' => array('title' => __('Add Images to Gallery', 'colabsthemes'), 'button_text' => __('Add to gallery', 'colabsthemes')), 'file_upload' => array('title' => __('Choose a File', 'colabsthemes'), 'button_text' => __('Insert file URL', 'colabsthemes')), 'validator' => array('required' => __('This field is required', 'colabsthemes'), 'terms' => __('You need to aggree with our terms', 'colabsthemes')), 'delete_confirm' => __("Are your sure you want to delete this? It can't be undone.", 'colabsthemes'), 'cancel_order_confirm' => __("Are you sure you want to cancel this order? It can't be undone.", 'colabsthemes'), 'rent_term_id' => $term_id); wp_localize_script('scripts', 'formbuilder_string', $formbuilder_string); if (is_page_template('template-profile.php')) { wp_enqueue_script('password-strength-meter'); wp_enqueue_script('zxcvbn-async'); wp_enqueue_script('custom-strengthmeter', trailingslashit(get_template_directory_uri()) . 'includes/js/custom-strengthmeter.js'); } }
/** * Adjust the content width for Front Page, Full Width and Grid Page Template. */ function edin_content_width() { global $content_width; if (is_page_template('page-templates/front-page.php') || is_page_template('page-templates/full-width-page.php') || is_page_template('page-templates/grid-page.php')) { $content_width = 1086; } }
function tography_lite_enqueue_stylesheets() { //Bootstrap ======================================================= wp_register_style('bootstrap', TOGRAPHY_LITE_CSS . '/bootstrap.css', array(), '3.1', 'all'); wp_enqueue_style('bootstrap'); //================================================================= if (is_page_template('page-portfolio-thirds.php') || is_archive()) { //Isotope ================================================ wp_register_style('isotope', TOGRAPHY_LITE_CSS . '/isotope.css', array(), '1.0', 'all'); wp_enqueue_style('isotope'); //================================================================= //Photoswipe ====================================================== wp_register_style('photoswipe', TOGRAPHY_LITE_CSS . '/photoswipe.css', array(), '2.0.0', 'all'); wp_enqueue_style('photoswipe'); //================================================================= //Photoswipe Skin ====================================================== wp_register_style('photoswipe-skin', TOGRAPHY_LITE_CSS . '/default-skin/default-skin.css', array(), '2.0.0', 'all'); wp_enqueue_style('photoswipe-skin'); //================================================================= } if (is_single() || is_archive()) { //Photoswipe ====================================================== wp_register_style('photoswipe', TOGRAPHY_LITE_CSS . '/photoswipe.css', array(), '2.0.0', 'all'); wp_enqueue_style('photoswipe'); //================================================================= //Photoswipe Skin ====================================================== wp_register_style('photoswipe-skin', TOGRAPHY_LITE_CSS . '/default-skin/default-skin.css', array(), '2.0.0', 'all'); wp_enqueue_style('photoswipe-skin'); //================================================================= } //Main Stylesheet ================================================= wp_register_style('main-stylesheet', get_bloginfo('stylesheet_url'), array('bootstrap'), '1.0', 'all'); wp_enqueue_style('main-stylesheet'); //================================================================= }
function custom_body_class() { $options = get_desing_plus_option(); echo ' class="'; if (!is_page() && is_home()) { echo ' index'; } if ($options['header_layout'] == 'fixed') { echo ' fixed_header'; } if ($options['layout'] == 'right') { echo ' layout1'; } elseif ($options['layout'] == 'left') { echo ' layout2'; } else { echo ' three_column'; } if ($options['layout'] == 'three_column1') { echo ' layout3'; } elseif ($options['layout'] == 'three_column2') { echo ' layout4'; } if (is_page_template('page-noside.php')) { echo ' no_side'; } echo ' custom-background"'; }
/** * Enqueue scripts and styles for the front end. * * @since Twenty Fourteen 1.0 */ function ieseg2_scripts() { //<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,300,400italic' rel='stylesheet' type='text/css'> // Add Source Sans. wp_enqueue_style('ieseg-source-sans', 'http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,300,400italic', array(), null); // Add Genericons font, used in the main stylesheet. //wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.2' ); // Load our main stylesheet. //wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri(), array( 'genericons' ) ); wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', false, '1.0'); wp_enqueue_style('bootstrap-theme', get_template_directory_uri() . '/css/bootstrap-theme.min.css', array('bootstrap'), '1.0'); wp_enqueue_style('animate', get_template_directory_uri() . '/css/animate.css', false, '1.0'); // utile pour wow.js wp_enqueue_style('style-ieseg', get_template_directory_uri() . '/css/ieseg.min.css', array('bootstrap'), '1.0'); if (is_page(array(1766, 59))) { wp_enqueue_style('style-timeline', get_template_directory_uri() . '/css/timeline.css'); } //wp_enqueue_style('fancybox','/wp-content/themes/'.get_template().'/lib/fancybox/jquery.fancybox-1.3.4.css',false,'1.0'); // Load the Internet Explorer specific stylesheet. //wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style', 'genericons' ), '20131205' ); //wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' ); //BX slider if (is_front_page() || is_page_template('template-page-programs.php')) { wp_enqueue_script('bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '1.0', true); wp_enqueue_style('style-bxslider', get_template_directory_uri() . '/css/jquery.bxslider.css', array('style-ieseg'), '1.0'); } wp_enqueue_script('ieseg-script', get_template_directory_uri() . '/js/ieseg.js', array('jquery'), '1.0', true); wp_enqueue_script('bootstrap-script', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '1.0', true); wp_enqueue_script('wow', get_template_directory_uri() . '/js/wow.min.js', array('jquery'), '1.0', true); //wp_enqueue_script( 'responsive-nav', get_template_directory_uri() . '/js/responsive-nav.min.js', array( 'jquery' ), '1.0', true ); //menu de gauche responsive if (is_page(array('mib-class-profile', 'mib-career-opportunities', 'mfm-student-profiles', 'msc-digital-marketing-crm-class-profile', 'msc-business-analysis-consulting-class-profile', 'msc-accounting-audit-control', 'msc-finance-class-profile', 'msc-banking-capital-markets-class-profile', 'msc-in-negotiation-for-organizations-class-profile', 'msc-big-data-analytics-business-class-profile', 'imba-class-profile', 'programme-grande-ecole', 33306, 33325))) { wp_enqueue_script('classprofiles', get_bloginfo('template_directory') . '/js/classprofiles.js', array(), '1.1', true); } }
function woothemes_add_css() { global $woo_options; wp_register_style('prettyPhoto', get_template_directory_uri() . '/includes/css/prettyPhoto.css'); wp_register_style('non-responsive', get_template_directory_uri() . '/css/non-responsive.css'); // Disable prettyPhoto css if WooCommerce is activated and user is on the product page $woocommerce_activated = is_woocommerce_activated(); $woocommerce_lightbox = get_option('woocommerce_enable_lightbox') == 'yes' ? true : false; $woocommerce_product = false; if ($woocommerce_activated) { $woocommerce_product = is_product(); } if ($woocommerce_activated && $woocommerce_product && $woocommerce_lightbox) { wp_deregister_style('prettyPhoto'); } // Conditionally load the Portfolio CSS, where needed. $load_portfolio_css = false; if (is_page_template('template-portfolio.php') || is_singular() && get_post_type() == 'portfolio' || is_post_type_archive('portfolio') || is_tax('portfolio-gallery')) { $load_portfolio_css = true; } // Allow child themes/plugins to load the portfolio CSS when they need it. $load_portfolio_css = apply_filters('woo_load_portfolio_css', $load_portfolio_css); if ($load_portfolio_css) { wp_enqueue_style('prettyPhoto'); } do_action('woothemes_add_css'); }
function tfuse_class($param, $return = false) { $tfuse_class = ''; $sidebar_position = tfuse_sidebar_position(); if ($param == 'middle') { if (is_page_template('template-contact.php')) { if ($sidebar_position == 'left') { $tfuse_class = ' class="middle sidebarLeft nobg"'; } elseif ($sidebar_position == 'right') { $tfuse_class = ' class="middle sidebarRight nobg"'; } else { $tfuse_class = ' class="middle"'; } } else { if ($sidebar_position == 'left') { $tfuse_class = ' class="middle sidebarLeft"'; } elseif ($sidebar_position == 'right') { $tfuse_class = ' class="middle sidebarRight"'; } else { $tfuse_class = ' class="middle"'; } } } elseif ($param == 'content') { $tfuse_class = isset($sidebar_position) && $sidebar_position != 'full' ? ' class="grid_8 content"' : ' class="content"'; } if ($return) { return $tfuse_class; } else { echo $tfuse_class; } }
function planar_content_width() { global $content_width; if (is_front_page() || is_page_template('page-templates/page-fullwidth.php') || is_page_template('page-templates/homepage-one.php') || is_page_template('page-templates/page-childgrid.php')) { $content_width = 1400; } }
function load_main_scripts() { wp_register_script('scripts', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), filemtime(get_template_directory() . '/assets/js/scripts.js'), true); // Loads in the footer with cache busting wp_register_script('collapsible', get_template_directory_uri() . '/assets/js/jquery.collapsible.min.js', array('jquery'), 1.0, true); wp_register_script('modernizer', get_template_directory_uri() . '/assets/js/modernizr-2.6.1-respond-1.1.0.min.js'); wp_register_script('magnific', get_template_directory_uri() . '/assets/js/jquery.magnific.min.js', array('jquery')); wp_register_script('select', get_template_directory_uri() . '/assets/js/bootstrap-select.min.js', array('jquery')); wp_register_script('dropdown', get_template_directory_uri() . '/assets/js/bootstrap-dropdown.js', array('jquery'), 1.0, true); wp_register_script('fitvids', get_template_directory_uri() . '/assets/js/jquery.fitvids.js', array('jquery'), 1.0, true); wp_register_script('tabaccord', get_template_directory_uri() . '/assets/js/easyResponsiveTabs.js', array('jquery'), 1.0, true); //wp_register_script( 'placeholders', get_template_directory_uri() . '/assets/js/Placeholders.js', array( 'jquery' ), 1.0, true ); //wp_register_script( 'glossary', get_template_directory_uri() . '/assets/js/jquery.zglossary.min.js', array( 'jquery' ), 1.0, true ); wp_enqueue_script('modernizer'); wp_enqueue_script('scripts'); wp_enqueue_script('select'); wp_enqueue_script('dropdown'); wp_enqueue_script('magnific'); wp_enqueue_script('fitvids'); //wp_enqueue_script( 'placeholders' ); wp_enqueue_script('tabaccord'); if (is_page() or get_post_type() == 'state' or get_post_type() == 'faq') { wp_enqueue_script('collapsible'); } if (!is_front_page() or !is_post_type_archive('glossary')) { wp_enqueue_script('glossary'); } if (is_page_template('page-templates/template-video-gallery.php')) { // load only on video gallery wp_enqueue_script('lazyYT', get_template_directory_uri() . '/assets/js/lazyYT.js', array('jquery'), 1.0, true); // lazy load youtube } }
function woothemes_add_javascript() { global $woo_options; $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; // Register scripts wp_register_script('prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto' . $suffix . '.js', array('jquery'), '3.1.3'); wp_register_script('enable-lightbox', get_template_directory_uri() . '/includes/js/enable-lightbox.js', array('jquery', 'prettyPhoto')); wp_register_script('google-maps', 'http://maps.google.com/maps/api/js?sensor=false'); wp_register_script('google-maps-markers', get_template_directory_uri() . '/includes/js/markers.js'); wp_register_script('flexslider', get_template_directory_uri() . '/includes/js/jquery.flexslider' . $suffix . '.js', array('jquery'), '2.1'); wp_register_script('featured-slider', get_template_directory_uri() . '/includes/js/featured-slider' . $suffix . '.js', array('jquery', 'flexslider')); wp_register_script('jquery-waypoints', get_template_directory_uri() . '/includes/js/waypoints' . $suffix . '.js', array('jquery'), '2.0.3'); // Enqueue third party scripts wp_enqueue_script('fitvids', get_template_directory_uri() . '/includes/js/fitvids' . $suffix . '.js', array('jquery'), '1.0'); wp_enqueue_script('modernizr', get_template_directory_uri() . '/includes/js/modernizr' . $suffix . '.js', array('jquery'), '2.6.2'); wp_enqueue_script('doubleTapToGo', get_template_directory_uri() . '/includes/js/jquery.doubleTapToGo' . $suffix . '.js', array('jquery'), '1.0'); // Enqueue scripts wp_enqueue_script('jquery-waypoints'); wp_enqueue_script('general', get_template_directory_uri() . '/includes/js/general' . $suffix . '.js', array('jquery')); // Load Google Script on Contact Form Page Template if (is_page_template('template-contact.php')) { wp_enqueue_script('google-maps'); wp_enqueue_script('google-maps-markers'); } // End If Statement do_action('woothemes_add_javascript'); }
function airballoon_display_custom_header() { // Get Theme Options from Database $options = get_option('zeenoble_options'); // Don't display header image on template-frontpage.php if (is_page_template('template-frontpage.php')) { return; } // Don't display header image when "display frontpage template automatically on home page" option is activated if (is_front_page() and isset($options['themeZee_frontpage_activate']) and $options['themeZee_frontpage_activate'] == 'true') { return; } // Check if page is displayed and featured header image is used if (is_page() && has_post_thumbnail()) { ?> <div id="custom-header"> <?php the_post_thumbnail('frontpage_slider_image'); ?> </div> <?php // Check if there is a custom header image } elseif (get_header_image()) { ?> <div id="custom-header"> <img src="<?php echo get_header_image(); ?> " /> </div> <?php } }
function the_content($content) { // Don't show on custom page templates if (is_page_template()) { return $content; } // Don't show on Stacked slides if (get_post_type() == 'slide') { return $content; } global $wp_current_filter; if (in_array('get_the_excerpt', (array) $wp_current_filter)) { return $content; } $cce_options = get_option('cce_options'); $show_on_posts = isset($cce_options['show_loveit_button_on']['post']) ? $cce_options['show_loveit_button_on']['post'] : FALSE; $show_on_pages = isset($cce_options['show_loveit_button_on']['page']) ? $cce_options['show_loveit_button_on']['page'] : FALSE; if (is_singular('post') && $show_on_posts) { $content .= $this->do_likes('loveit-after-content'); } if (is_page() && !is_front_page() && $show_on_pages) { $content .= $this->do_likes('loveit-after-content'); } //Under consideration: if(( is_front_page() || is_home() || is_category() || is_tag() || is_author() || is_date() || is_search()) && $options['add_to_other'] ) $content .= $this->do_likes(); return $content; }
function meanthemes_load_js() { wp_register_style('meanmenu', get_template_directory_uri() . '/assets/js/plugins/meanmenu.min.css', array(), '1.0.7', 'screen', 'meanmenu'); wp_register_script('meanmenu', get_template_directory_uri() . '/assets/js/plugins/jquery.meanmenu.min.js', array('jquery'), '2.0.8', true); wp_register_script('jplayer', get_template_directory_uri() . '/assets/js/plugins/jquery.jplayer.min.js', array('jquery'), '1.0.0', true); wp_register_script('flexslider', get_template_directory_uri() . '/assets/js/plugins/jquery.flexslider-min.js', array('jquery'), '1.0.0', true); wp_register_script('slabtext', get_template_directory_uri() . '/assets/js/plugins/jquery.slabtext.min.js', array('jquery'), '2.3', true); wp_register_script('global', get_template_directory_uri() . '/assets/js/plugins/global-plugins.min.js', array('jquery'), MEANTHEMES_THEME_VER, false); wp_register_script('mt-scripts', get_template_directory_uri() . '/assets/js/scripts.min.js', array('jquery', 'global'), MEANTHEMES_THEME_VER, true); if (is_single() || is_archive() || is_search() || is_author() || is_front_page() || is_page_template('t-index.php')) { wp_enqueue_script('jplayer'); wp_enqueue_script('flexslider'); } if (is_home() || is_404()) { wp_enqueue_script('slabtext'); } if (!is_home() || !is_404()) { wp_enqueue_style('webfonts'); } // Check theme options for using a standard menu if (get_theme_mod('use_standard_menu', '0') == '1') { wp_enqueue_style('meanmenu'); wp_enqueue_script('meanmenu'); } // load on all pages wp_enqueue_script('global'); wp_enqueue_script('mt-scripts'); }
/** * Add breadcrumbs functionality to your WordPress theme * * Once you have included the function in your functions.php file * you can then place the following anywhere in your theme templates * if(function_exists('bootstrap_breadcrumbs')) bootstrap_breadcrumbs(); * * credit to: c.bavota - http://bavotasan.com (thanks for the code start) */ function bootstrap_breadcrumbs() { echo '<ol class="breadcrumb">'; echo '<li><a href="' . home_url('/') . '">Home</a></li>'; // are we at "blog home"? if (is_home()) { echo '<li><a href="#">Blogs</a></li>'; } // where else do we want breadcrumbs if (!is_page_template('pt-home.php') && !is_home()) { // check if we're in a commerce plugin if (function_exists('is_woocommerce') && is_woocommerce()) { echo '<li><a href="/publications/order/">Shop</a></li>'; $product_cats = wp_get_post_terms(get_the_ID(), 'product_cat'); echo '<li><a href="/publications/order/' . str_replace(" ", "-", $product_cats[0]->name) . '">' . $product_cats[0]->name . '</a></li>'; } // breadcrumb wordpress structures if (is_category() || is_single() || is_single('aof')) { if (get_the_category()) { $category = get_the_category(); echo '<li><a href="/blog/category/' . str_replace(" ", "-", $category[0]->cat_name) . '">' . $category[0]->cat_name . '</a></li>'; } if (is_single()) { echo '<li class="active">'; the_title(); echo '</li>'; } } elseif (is_page()) { echo '<li class="active">'; the_title(); echo '</li>'; } } echo '</ol>'; }