/** * Enqueue scripts and styles. */ function educator_enqueue_scripts() { $disable_lightbox = (int) get_theme_mod('disable_lightbox', 0); $owl_carousel = (int) get_theme_mod('owl_carousel', 1); // Enqueue fonts. $fonts_url = educator_theme_fonts_url(); if ($fonts_url) { wp_enqueue_style('educator-google-fonts', $fonts_url); } // Enqueue stylesheets. wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.2.0'); wp_enqueue_style('flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), '2.2.2'); if (0 == $disable_lightbox) { // Magnific popup. wp_enqueue_style('magnific-popup', get_template_directory_uri() . '/css/magnific-popup.css', array(), '0.9.9'); wp_enqueue_script('magnific-popup', get_template_directory_uri() . '/js/jquery.magnific-popup.js', array('jquery'), '0.9.9', true); } // Include the chosen version of Owl Carousel. if (2 == $owl_carousel) { wp_enqueue_style('owl-carousel', get_template_directory_uri() . '/css/owl.carousel-2/owl.carousel.css', array(), '2.0.0-beta.3'); wp_enqueue_script('owl-carousel', get_template_directory_uri() . '/js/owl.carousel-2.js', array('jquery'), '2.0.0-beta.3', true); } else { wp_enqueue_style('owl-carousel', get_template_directory_uri() . '/css/owl.carousel.css', array(), '1.3.3'); wp_enqueue_script('owl-carousel', get_template_directory_uri() . '/js/owl.carousel.js', array('jquery'), '1.3.3', true); } wp_enqueue_style('educator-style', get_template_directory_uri() . '/style.css', array(), '1.8.5'); // Scripts. wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/modernizr.js', array(), '2.8.3'); wp_enqueue_script('jquery-validate', get_template_directory_uri() . '/js/jquery.validate.js', array('jquery'), '1.13.1'); wp_enqueue_script('flexslider', get_template_directory_uri() . '/js/jquery.flexslider.js', array('jquery'), '2.2.2', true); wp_enqueue_script('educator-base', get_template_directory_uri() . '/js/base.js', array('jquery'), '1.7.0', true); wp_enqueue_script('educator-main', get_template_directory_uri() . '/js/main.js', array('jquery'), '1.7.0', true); wp_localize_script('educator-main', 'eduThemeObj', array('disableLightbox' => $disable_lightbox, 'owlCarousel' => $owl_carousel)); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } }
/** * Output customized style. */ public static function output_style() { $text_color = self::sanitize_hex_color(get_theme_mod('text_color', '#555555')); $main_color = self::sanitize_hex_color(get_theme_mod('main_color', '#149dd2')); $hover_color = self::sanitize_hex_color(get_theme_mod('hover_color', '#057caa')); $headings_color = self::sanitize_hex_color(get_theme_mod('headings_color', '#333333')); $hover_bg = self::sanitize_hex_color(get_theme_mod('hover_bg', '#f5f5f5')); $hover_text = self::sanitize_hex_color(get_theme_mod('hover_text', '#149dd2')); $headings_font_weight = self::sanitize_font_weight(get_theme_mod('headings_font_weight', '600')); $bold_font_weight = self::sanitize_font_weight(get_theme_mod('bold_font_weight', '600')); $headings_font = self::sanitize_font_name(get_theme_mod('headings_font', 'Open Sans')); $body_font = self::sanitize_font_name(get_theme_mod('body_font', 'Open Sans')); $font_size = self::sanitize_font_size(get_theme_mod('font_size', 14)); if (!empty($headings_font) && 'Default' != $headings_font) { $headings_font = '"' . $headings_font . '", "Helvetica Neue", Helvetica, Arial, sans-serif'; } else { $headings_font = '"Helvetica Neue", Helvetica, Arial, sans-serif'; } if (!empty($body_font) && 'Default' != $body_font) { $body_font = '"' . $body_font . '", "Helvetica Neue", Helvetica, Arial, sans-serif'; } else { $body_font = '"Helvetica Neue", Helvetica, Arial, sans-serif'; } ?> <style> <?php // Fonts. if ($fonts_url = educator_theme_fonts_url()) { echo '@import url(' . esc_url($fonts_url) . ');'; } ?> body { color: <?php echo $text_color; ?> ; font-family: <?php echo $body_font; ?> ; font-size: <?php echo $font_size . 'px'; ?> ; } h1, h2, h3, h4, h5, h6 { color: <?php echo $headings_color; ?> ; font-family: <?php echo $headings_font; ?> ; font-weight: <?php echo $headings_font_weight; ?> ; } #main-logo img {max-height: <?php echo intval(get_theme_mod('logo_height', 28)); ?> px;} strong, table th, label, .ib-edu-course-price .price, .ib-edu-price-widget .price, .ib-edu-form fieldset legend, .ib-edu-question .label, .educator-share-links .label, .dm3-testimonial-name, .drop-down > a, .drop-down:hover > a, .drop-down.open > a, #payment-details td:first-child, .payment-total, .payment-total + dd, .lesson-compact h1 > a, ul.edr-syllabus-lessons h4 > a, ul.products h3, .woocommerce-breadcrumb a, .product_list_widget li > a, td.product-name > a { color: <?php echo $headings_color; ?> ; font-weight: <?php echo $bold_font_weight; ?> ; } #main-nav > ul > li > a, #auth-nav .auth-nav-login, #user-nav .user-menu-name, .ib-edu-courses .title, .pagination .text, .pagination .page-numbers, .woocommerce-pagination a.page-numbers, .woocommerce-pagination span.page-numbers, .post-grid .price, .post-fw .price, .ib-edu-memberships .price, .related-courses .price, ul.products .price, .comment-author .fn, .the-tabs a, .page-links, .button, .ib-edu-button, input#submit, .search-submit, .post-password-form input[type="submit"], .button-primary, .dm3-btn, .ib-edu-lessons .ib-edu-lesson:before, .lessons-nav li:before, .lessons-nav span, .ib-edu-lesson-meta .quiz, .product .onsale, .tagcloud a { font-weight: <?php echo $bold_font_weight; ?> ; } .dm3-tabs-nav a, .the-tabs a, .dm3-collapse-trigger a { color: #333; font-weight: <?php echo $bold_font_weight; ?> ; } #mobile-nav .auth-nav a, #mobile-nav .user-menu-name { font-weight: <?php echo $bold_font_weight; ?> ; } .ib-edu-lessons article h1 a, .entry-title a, .wp-caption-text, blockquote, body .dm3-tabs-testimonials blockquote, .ib-edu-memberships h2 a { color: <?php echo $headings_color; ?> ; } a { color: <?php echo $main_color; ?> ; } a:hover { color: <?php echo $hover_color; ?> ; } .button, .ib-edu-button, input#submit, .search-submit, .post-password-form input[type="submit"], .button-primary, .dm3-btn { border-color: <?php echo $main_color; ?> ; color: <?php echo $main_color; ?> ; } .ib-edu-lessons .ib-edu-completed:before, .lessons-nav .ib-edu-completed:before { border-color: <?php echo $main_color; ?> ; color: <?php echo $main_color; ?> ; } .button:hover, .ib-edu-button:hover, input#submit:hover, .search-submit:hover, .post-password-form input[type="submit"]:hover, .button-primary:hover, .dm3-btn:hover, .css3-loader-inner div, #main-nav > ul > .current-menu-item > a:after, #main-nav > ul > .current-menu-parent > a:after, #main-nav .sub-menu:before, #user-nav ul:before, .dm3-tabs-testimonials .dm3-tabs-nav .active a, .flex-control-paging .flex-active:after, .owl-page.active span, .product .onsale { background-color: <?php echo $main_color; ?> ; } #main-nav > ul > li:hover > a, #main-nav > ul > .current-menu-item > a, #main-nav > ul > .current-menu-parent > a, #main-nav .sub-menu a:hover, #user-nav li a:hover, #header-search button:hover, #header-search.open button, #auth-nav .auth-nav-login:hover, .hentry .ib-edu-lessons article h1 a:hover, .ib-edu-memberships h2 a:hover, .entry-title a:hover, .post-grid .price, .post-fw .price, ul.products .price, .related-courses .price, .ib-edu-memberships .price, .no-touch .post-meta a:hover, .post-meta .price, .comment-metadata a:hover, .dm3-box-icon-center .dm3-box-icon-icon span, .dm3-box-icon-left .dm3-box-icon-icon, .page-sidebar .cat-item a:hover, .page-sidebar .widget_archive a:hover, .page-sidebar .recentcomments a:hover, .page-sidebar .widget_recent_entries a:hover, .custom-radio:before, #user-nav:hover .user-menu-name, .ib-edu-message:before, .ib-edu-lesson-meta .quiz, .lessons-nav a:hover, #page-toolbar .cart-stats a:hover, .ib-edu-courses .open-description:hover, .product_list_widget li > a:hover, td.product-name > a:hover { color: <?php echo $main_color; ?> ; } .ib-edu-message:after { border-color: <?php echo $main_color; ?> ; } .post-badge:before { border-color: <?php echo $main_color; ?> <?php echo $main_color; ?> transparent transparent; } #main-nav .sub-menu > li:last-child > a:hover, #user-nav ul > li:last-child > a:hover { border-color: <?php echo $hover_bg; ?> ; } .educator-share-links a:hover, .share-links-menu .educator-share-links a:hover { background-color: <?php echo $hover_bg; ?> ; color: <?php echo $text_color; ?> ; } .no-touch .share-links-menu:hover > a, .share-links-menu.open > a, .dm3-tabs-nav a:hover, .dm3-collapse-trigger a:hover, .the-tabs a:hover, .drop-down.open > a .icon, .pagination .next:hover, .pagination .prev:hover, #main-nav .sub-menu a:hover, #user-nav li a:hover, .drop-down li a:hover { background-color: <?php echo $hover_bg; ?> ; color: <?php echo $hover_text; ?> ; } .dm3-tabs-nav .active a, .dm3-collapse-open .dm3-collapse-trigger a, .the-tabs .active a { background-color: #fff; color: <?php echo $hover_text; ?> ; } .post-fw .post-meta, .post-grid .post-meta, .page-sidebar .widget, .lecturers-grid, #main-nav .sub-menu, #user-nav .menu { box-shadow: 0 1px 2px 0 rgba(0,0,0,.07); } </style> <?php }