Ejemplo n.º 1
0
function kopa_admin_print_styles()
{
    $dir = get_template_directory_uri() . '/library/css';
    wp_enqueue_style('kopa-admin-style', "{$dir}/style.css", array(), NULL);
    wp_enqueue_style('thickbox.css', '/' . WPINC . '/js/thickbox/thickbox.css', array(), NULL);
    wp_enqueue_style('open-sans-font', 'http://fonts.googleapis.com/css?family=Open+Sans:400,700,600', array(), NULL);
    if (!wp_style_is('wp-color-picker')) {
        wp_enqueue_style('wp-color-picker');
    }
    wp_enqueue_style('kopa-admin-fontawesome', get_template_directory_uri() . '/css/font-awesome.css', array(), NULL);
    $google_fonts = kopa_get_google_font_array();
    $current_heading_font = get_option('kopa_theme_options_heading_font_family', array(), NULL);
    $current_content_font = get_option('kopa_theme_options_content_font_family');
    $current_main_nav_font = get_option('kopa_theme_options_main_nav_font_family');
    $current_wdg_sidebar_font = get_option('kopa_theme_options_wdg_sidebar_font_family');
    $current_wdg_main_font = get_option('kopa_theme_options_wdg_main_font_family');
    $current_wdg_footer_font = get_option('kopa_theme_options_wdg_footer_font_family');
    $current_slider_font = get_option('kopa_theme_options_slider_font_family');
    $load_font_array = array();
    if ($current_heading_font) {
        array_push($load_font_array, $current_heading_font);
    }
    if ($current_content_font && !in_array($current_content_font, $load_font_array)) {
        array_push($load_font_array, $current_content_font);
    }
    if ($current_main_nav_font && !in_array($current_main_nav_font, $load_font_array)) {
        array_push($load_font_array, $current_main_nav_font);
    }
    if ($current_wdg_sidebar_font && !in_array($current_wdg_sidebar_font, $load_font_array)) {
        array_push($load_font_array, $current_wdg_sidebar_font);
    }
    if ($current_wdg_main_font && !in_array($current_wdg_main_font, $load_font_array)) {
        array_push($load_font_array, $current_wdg_main_font);
    }
    if ($current_wdg_footer_font && !in_array($current_wdg_footer_font, $load_font_array)) {
        array_push($load_font_array, $current_wdg_footer_font);
    }
    if ($current_slider_font && !in_array($current_slider_font, $load_font_array)) {
        array_push($load_font_array, $current_slider_font);
    }
    foreach ($load_font_array as $current_font) {
        if ($current_font != '') {
            $google_font_family = $google_fonts[$current_font]['family'];
            $temp_font_name = str_replace(' ', '+', $google_font_family);
            $font_url = 'http://fonts.googleapis.com/css?family=' . $temp_font_name . ':300,300italic,400,400italic,700,700italic&subset=latin';
            wp_enqueue_style('Google-Font-' . $temp_font_name, $font_url, array(), NULL);
        }
    }
}
Ejemplo n.º 2
0
function kopa_head()
{
    $logo_margin_top = get_option('kopa_theme_options_logo_margin_top');
    $logo_margin_left = get_option('kopa_theme_options_logo_margin_left');
    $logo_margin_right = get_option('kopa_theme_options_logo_margin_right');
    $logo_margin_bottom = get_option('kopa_theme_options_logo_margin_bottom');
    $kopa_theme_options_color_code = get_option('kopa_theme_options_color_code', '#e03d3d');
    echo "<style>\n        #logo-image{\n        margin-top:{$logo_margin_top}px;\n        margin-left:{$logo_margin_left}px;\n        margin-right:{$logo_margin_right}px;\n        margin-bottom:{$logo_margin_bottom}px;\n        }\n        </style>";
    /* =========================================================
       Main Colorscheme
       ============================================================ */
    /* ==================================================================================================
     * Custom heading color
     * ================================================================================================= */
    /* =========================================================
       Font family
       ============================================================ */
    $google_fonts = kopa_get_google_font_array();
    $current_heading_font = get_option('kopa_theme_options_heading_font_family');
    $current_content_font = get_option('kopa_theme_options_content_font_family');
    $current_main_nav_font = get_option('kopa_theme_options_main_nav_font_family');
    $current_wdg_sidebar_font = get_option('kopa_theme_options_wdg_sidebar_font_family');
    $load_font_array = array();
    if ($current_heading_font) {
        $google_font_family = $google_fonts[$current_heading_font]['family'];
        echo "<style>\n        h1, h2, h3, h4, h5, h6,\n        .accordion-title h3 {\n        font-family: '{$google_font_family}', sans-serif;\n        }\n        </style>";
    }
    if ($current_content_font) {
        $google_font_family = $google_fonts[$current_content_font]['family'];
        echo "<style>\n        body,\n        .breadcrumb,\n        .sidebar .kopa-categories-widget ul li a,\n        .list-container-1 ul li a,\n        .list-container-2 .tabs-2 li a,\n        .bottom-sidebar .newsletter-form .submit,\n        .entry-categories a,\n        .pagination .page-numbers li a, .pagination .page-numbers li span,\n        .error-404 .left-col p,\n        .wp-link-pages, .wp-link-pages a {\n        font-family: '{$google_font_family}', sans-serif;\n        }\n        </style>";
    }
    if ($current_main_nav_font) {
        $google_font_family = $google_fonts[$current_main_nav_font]['family'];
        echo "<style>\n        #main-menu > li > a,\n        #main-menu li ul li a {\n        font-family: '{$google_font_family}', sans-serif;\n        }\n        </style>";
    }
    if ($current_wdg_sidebar_font) {
        $google_font_family = $google_fonts[$current_wdg_sidebar_font]['family'];
        echo "<style>\n        .widget .widget-title,\n        .kopa-related-post h3,\n        #comments h3,\n        #respond h3,\n        #contact-box h3,\n        #contact-box .title-text {\n        font-family: '{$google_font_family}', sans-serif;\n        }\n        </style>";
    }
    /* =========================================================
       Font size
       ============================================================ */
    /* ================================================================================
       * Font weight
       ================================================================================ */
    /* ==================================================================================================
     * Custom heading color
     * ================================================================================================= */
    /* ================================================================================
       * Custom Background
       ================================================================================ */
    /* ================================================================================
       * Custom Header Background
       ================================================================================ */
    /* ==================================================================================================
     * Custom CSS
     * ================================================================================================= */
    /* ==================================================================================================
     * IE8 Fix CSS3
     * ================================================================================================= */
    echo "<style>\n        .kp-dropcap.color,\n        .kopa-carousel-widget .pager a,\n        .kopa-video-widget ul li .entry-item .entry-content .entry-thumb .play-icon,\n        .widget-area-12 .kopa-entry-list-widget .kopa-entry-list .play-icon,\n        .kp-gallery-slider .play-icon,\n        .kp-gallery-carousel .play-icon {\n        behavior: url(" . get_template_directory_uri() . "/js/PIE.htc);\n        }\n        </style>";
    /*
    post metadata
    */
    $metadata = '';
    if (get_option('kopa_theme_options_post_categories', 'show') == 'hide') {
        $metadata .= '.entry-box .entry-categories{
                        display:none;
                    }';
    }
    if (get_option('kopa_theme_options_post_date', 'show') == 'hide') {
        $metadata .= '.entry-box .entry-date{
                        display:none;
                    }';
    }
    if (get_option('kopa_theme_options_post_author', 'show') == 'hide') {
        $metadata .= '.entry-box .entry-author{
                        display:none;
                    }';
    }
    if (get_option('kopa_theme_options_post_comment', 'show') == 'hide') {
        $metadata .= '.entry-box .entry-comments{
                        display:none;
                    }';
    }
    if (get_option('kopa_theme_options_post_visit', 'show') == 'hide') {
        $metadata .= '.entry-box .entry-view{
                        display:none;
                    }';
    }
    if ($metadata != '') {
        echo '<style>
        ' . $metadata . '
        </style>';
    }
}
Ejemplo n.º 3
0
function kopa_head()
{
    $logo_margin_top = get_option('kopa_theme_options_logo_margin_top');
    $logo_margin_left = get_option('kopa_theme_options_logo_margin_left');
    $logo_margin_right = get_option('kopa_theme_options_logo_margin_right');
    $logo_margin_bottom = get_option('kopa_theme_options_logo_margin_bottom');
    echo "<style type='text/css'>\r\n        .logo-image{\r\n            margin-top:{$logo_margin_top}px;\r\n            margin-left:{$logo_margin_left}px;\r\n            margin-right:{$logo_margin_right}px;\r\n            margin-bottom:{$logo_margin_bottom}px;\r\n        } \r\n    </style>";
    /* =========================================================
       Main Colorscheme
       ============================================================ */
    /* ==================================================================================================
     * Custom heading color
     * ================================================================================================= */
    /* =========================================================
       Font family
       ============================================================ */
    $google_fonts = kopa_get_google_font_array();
    $current_heading_font = get_option('kopa_theme_options_heading_font_family');
    $current_content_font = get_option('kopa_theme_options_content_font_family');
    $current_main_nav_font = get_option('kopa_theme_options_main_nav_font_family');
    $current_wdg_sidebar_font = get_option('kopa_theme_options_wdg_sidebar_font_family');
    $load_font_array = array();
    if ($current_heading_font) {
        $google_font_family = $google_fonts[$current_heading_font]['family'];
        echo "<style>\r\n         h1, h2, h3, h4, h5, h6 {\r\n            font-family: '{$google_font_family}', sans-serif;\r\n        }\r\n        </style>";
    }
    if ($current_content_font) {
        $google_font_family = $google_fonts[$current_content_font]['family'];
        echo "<style>\r\n         body,\r\n         .pagination ul li,\r\n         .search-box .search-form .search-text,\r\n         .search-box .search-form .search-submit,\r\n         .widget_categories .postform, \r\n         .widget_archive select,\r\n         .list-container-3 ul li a,\r\n         #comments-form label.required, #contact-form label.required,\r\n         #comments-form #submit-comment, #contact-form #submit-contact,\r\n         .error-404 .left-col p\r\n          {\r\n            font-family: '{$google_font_family}', sans-serif;\r\n        }\r\n        </style>";
    }
    if ($current_main_nav_font) {
        $google_font_family = $google_fonts[$current_main_nav_font]['family'];
        echo "<style>\r\n        #main-menu > li > a,\r\n        #main-menu li ul li a,\r\n        #footer-menu li a {\r\n            font-family: '{$google_font_family}', sans-serif;\r\n        }\r\n        </style>";
    }
    if ($current_wdg_sidebar_font) {
        $google_font_family = $google_fonts[$current_wdg_sidebar_font]['family'];
        echo "<style>\r\n        .widget .widget-title,\r\n        #main-content .widget .widget-title {\r\n            font-family: '{$google_font_family}', sans-serif;\r\n        }\r\n        </style>";
    }
    /* =========================================================
       Font size
       ============================================================ */
    /* ================================================================================
       * Font weight
        ================================================================================ */
    /* ==================================================================================================
     * Custom CSS
     * ================================================================================================= */
    $kopa_theme_options_custom_css = htmlspecialchars_decode(stripslashes(get_option('kopa_theme_options_custom_css')));
    if ($kopa_theme_options_custom_css) {
        echo "<style>{$kopa_theme_options_custom_css}</style>";
    }
    /* ==================================================================================================
     * IE8 Fix CSS3
     * ================================================================================================= */
    echo "<!--[if lt IE 9]><style>\r\n        .flex-control-paging li a,\r\n        .carousel-nav a,\r\n        .kp-video-widget ul li .entry-item .entry-thumb .play-icon,\r\n        .search-box .search-form .search-text,\r\n        .search-box .search-form .search-submit,\r\n        .kp-gallery-slider .play-icon,\r\n        .kp-gallery-carousel .play-icon,\r\n        .kp-dropcap.color {\r\n            behavior: url(" . get_template_directory_uri() . "/js/PIE.htc);\r\n        }\r\n    </style><![endif]-->";
}
Ejemplo n.º 4
0
function kopa_front_enqueue_scripts()
{
    if (!is_admin()) {
        global $wp_styles, $is_IE;
        $dir = get_template_directory_uri();
        /* GOOGLE FONTS */
        wp_enqueue_script('kopa-google-api', 'http://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js', array(), NULL);
        wp_enqueue_script('kopa-google-fonts', $dir . '/js/google-fonts.js', array('kopa-google-api'), NULL);
        $google_fonts = kopa_get_google_font_array();
        $current_heading_font = get_option('kopa_theme_options_heading_font_family');
        $current_content_font = get_option('kopa_theme_options_content_font_family');
        $current_main_nav_font = get_option('kopa_theme_options_main_nav_font_family');
        $current_dropdown_font = get_option('kopa_theme_options_sub_nav_font_family');
        $current_wdg_sidebar_font = get_option('kopa_theme_options_wdg_sidebar_font_family');
        $current_wdg_main_font = get_option('kopa_theme_options_wdg_main_font_family');
        $current_wdg_footer_font = get_option('kopa_theme_options_wdg_footer_font_family');
        $current_slider_font = get_option('kopa_theme_options_slider_font_family');
        $load_font_array = array();
        // heading font family
        if ($current_heading_font && !in_array($current_heading_font, $load_font_array)) {
            array_push($load_font_array, $current_heading_font);
        }
        // content font family
        if ($current_content_font && !in_array($current_content_font, $load_font_array)) {
            array_push($load_font_array, $current_content_font);
        }
        // main menu font family
        if ($current_main_nav_font && !in_array($current_main_nav_font, $load_font_array)) {
            array_push($load_font_array, $current_main_nav_font);
        }
        // sub menu font family
        if ($current_dropdown_font && !in_array($current_dropdown_font, $load_font_array)) {
            array_push($load_font_array, $current_dropdown_font);
        }
        // right sidebar: widget title font family
        if ($current_wdg_sidebar_font && !in_array($current_wdg_sidebar_font, $load_font_array)) {
            array_push($load_font_array, $current_wdg_sidebar_font);
        }
        // main content sidebar: widget title font family
        if ($current_wdg_main_font && !in_array($current_wdg_main_font, $load_font_array)) {
            array_push($load_font_array, $current_wdg_main_font);
        }
        // footer sidebar: widget title font family
        if ($current_wdg_footer_font && !in_array($current_wdg_footer_font, $load_font_array)) {
            array_push($load_font_array, $current_wdg_footer_font);
        }
        foreach ($load_font_array as $current_font) {
            if ($current_font != '') {
                $google_font_family = $google_fonts[$current_font]['family'];
                $temp_font_name = str_replace(' ', '+', $google_font_family);
                $font_url = 'http://fonts.googleapis.com/css?family=' . $temp_font_name . ':300,300italic,400,400italic,700,700italic&subset=latin';
                wp_enqueue_style('Google-Font-' . $temp_font_name, $font_url);
            }
        }
        /* STYLESHEETs */
        wp_enqueue_style('kopa-bootstrap', $dir . '/css/bootstrap.css', array(), NULL, 'screen');
        wp_enqueue_style('kopa-fontawesome', $dir . '/css/font-awesome.css', array(), NULL);
        wp_enqueue_style('kopa-superfish', $dir . '/css/superfish.css', array(), NULL, 'screen');
        wp_enqueue_style('kopa-prettyPhoto', $dir . '/css/prettyPhoto.css', array(), NULL, 'screen');
        wp_enqueue_style('kopa-flexlisder', $dir . '/css/flexslider.css', array(), NULL, 'screen');
        wp_enqueue_style('kopa-sequence-style', $dir . '/css/sequencejs-theme.modern-slide-in.css', array(), NULL, 'screen');
        wp_enqueue_style('kopa-style', get_stylesheet_uri(), array(), NULL);
        wp_enqueue_style('kopa-bootstrap-responsive', $dir . '/css/bootstrap-responsive.css', array(), NULL);
        wp_enqueue_style('kopa-extra-style', $dir . '/css/extra.css', array(), NULL);
        wp_enqueue_style('kopa-responsive', $dir . '/css/responsive.css', array(), NULL);
        if ($is_IE) {
            wp_register_style('kopa-ie', $dir . '/css/ie.css', array(), NULL);
            $wp_styles->add_data('kopa-ie', 'conditional', 'lt IE 9');
            wp_enqueue_style('kopa-ie');
        }
        /* JAVASCRIPTs */
        wp_enqueue_script('kopa-modernizr', $dir . '/js/modernizr.custom.js');
        wp_enqueue_script('jquery');
        wp_localize_script('jquery', 'kopa_front_variable', kopa_front_localize_script());
        /**
         * Fix: Superfish conflicts with WP admin bar
         * @author joeldbirch
         * @link https://github.com/joeldbirch/superfish/issues/14
         * @filesource https://github.com/briancherne/jquery-hoverIntent 
         */
        wp_deregister_script('hoverIntent');
        wp_register_script('hoverIntent', '/js/jquery.hoverIntent.js', array('jquery'), 'r7');
        wp_enqueue_script('kopa-superfish-js', $dir . '/js/superfish.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-retina', $dir . '/js/retina.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-bootstrap-js', $dir . '/js/bootstrap.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-hoverdir', $dir . '/js/jquery.hoverdir.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-carouFredSel', $dir . '/js/jquery.carouFredSel-6.0.4-packed.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-flexlisder-js', $dir . '/js/jquery.flexslider-min.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-prettyPhoto-js', $dir . '/js/jquery.prettyPhoto.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-jflickrfeed', $dir . '/js/jflickrfeed.min.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-jquery-validate', $dir . '/js/jquery.validate.min.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-jquery-form', $dir . '/js/jquery.form.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-jquery-sequence', $dir . '/js/sequence.jquery-min.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-classie', $dir . '/js/classie.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-cbpAnimatedHeader', $dir . '/js/cbpAnimatedHeader.min.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-set-view-count', $dir . '/js/set-view-count.js', array('jquery'), NULL, TRUE);
        wp_enqueue_script('kopa-custom', $dir . '/js/custom.js', array('jquery'), NULL, TRUE);
        // send localization to frontend
        wp_localize_script('kopa-custom', 'kopa_custom_front_localization', kopa_custom_front_localization());
        if (is_single() || is_page()) {
            wp_enqueue_script('comment-reply');
        }
    }
}