Exemple #1
0
function customize_theme_button()
{
    if (is_demo() && !is_theme_customize() && !current_user_can('administrator')) {
        echo '<div class="options-panel-closed hidden-phone hidden-tablet" style="display: block;">';
        echo '<a target="_parent" href="/demo-login.php" title="Customize the theme">';
        echo '<span class="customize">';
        echo 'Click here<br />to customize<br />the theme</span>';
        echo '<img src="' . get_template_directory_uri() . '/images/tools-white.png" width="64" alt="Customize" title="Customize" />';
        echo '</a></div>';
    }
}
Exemple #2
0
function wf_theme_init()
{
    global $wf_theme_js_vars;
    if (!is_admin() && !wf_theme_is_login_page()) {
        wp_enqueue_style('wf-reset', get_template_directory_uri() . '/css/reset.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-bootstrap-responsive', get_template_directory_uri() . '/css/bootstrap-responsive.min.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-bootstrap-modal', get_template_directory_uri() . '/css/bootstrap-modal.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-style', get_template_directory_uri() . '/css/style.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-style-responsive', get_template_directory_uri() . '/css/style-responsive.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-prettyphoto', get_template_directory_uri() . '/css/prettyPhoto.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-skin', get_template_directory_uri() . '/css/color-themes/' . wf_theme_get_option('skin') . '.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-texture', get_template_directory_uri() . '/css/textures/' . wf_theme_get_option('texture') . '.css', array(), WF_THEME_VERSION);
        wp_enqueue_style('wf-background', get_template_directory_uri() . '/css/header-images/' . wf_theme_get_option('background') . '.css', array(), WF_THEME_VERSION);
        if (wf_theme_get_option('header_type') == '1' || wf_theme_get_option('header_type') == '2' || wf_theme_get_option('header_type') == '3' || wf_theme_get_option('header_type') == '5' || wf_theme_get_option('header_type') == '8' || wf_theme_get_option('header_type') == '9' || wf_theme_get_option('header_type') == '6' || wf_theme_get_option('header_type') == '7' || is_theme_customize()) {
            wp_enqueue_style('wf-flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), WF_THEME_VERSION);
        }
        wp_enqueue_script('jquery');
        wp_enqueue_script('wf_bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), WF_THEME_VERSION, true);
        wp_enqueue_script('wf_twitter', get_template_directory_uri() . '/js/jquery.tweet.js', array('jquery'), WF_THEME_VERSION, true);
        wp_enqueue_script('wf_prettyphoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', array('jquery'), WF_THEME_VERSION, true);
        wp_enqueue_script('wf_quvolver', get_template_directory_uri() . '/js/jquery.quovolver.js', array('jquery'), WF_THEME_VERSION, true);
        wp_enqueue_script('wf_form', get_template_directory_uri() . '/js/jquery.form.js', array('jquery'), WF_THEME_VERSION, true);
        wp_enqueue_script('wf_form_validate', get_template_directory_uri() . '/js/jquery.validate.js', array('jquery'), WF_THEME_VERSION, true);
        wp_enqueue_script('wf_redirect', get_template_directory_uri() . '/js/redirect.js', array('jquery'), WF_THEME_VERSION, true);
        if (wf_theme_get_option('header_type') == '1' || wf_theme_get_option('header_type') == '2' || wf_theme_get_option('header_type') == '3' || wf_theme_get_option('header_type') == '5' || wf_theme_get_option('header_type') == '6' || wf_theme_get_option('header_type') == '7' || wf_theme_get_option('header_type') == '8' || wf_theme_get_option('header_type') == '9' || is_theme_customize()) {
            wp_enqueue_script('wf_flexslider', get_template_directory_uri() . '/js/jquery.flexslider.js', array('jquery'), WF_THEME_VERSION, true);
        }
        wp_enqueue_script('wf_theme_common', get_template_directory_uri() . '/js/common.js', array('jquery'), WF_THEME_VERSION, true);
    }
    if (is_admin()) {
        wp_enqueue_style('wf-theme-admin', get_template_directory_uri() . '/admin/css/common.css', array(), WF_THEME_VERSION);
        wp_enqueue_script('wf-theme-admin', get_template_directory_uri() . '/admin/js/common.js', array('jquery'), WF_THEME_VERSION);
    }
    wp_localize_script('jquery', 'wf_theme', $wf_theme_js_vars);
    add_action('wp_ajax_wf_reset_colors', 'wf_theme_ajax_reset_colors');
    if (!session_id()) {
        @session_start();
    }
}