Ejemplo n.º 1
0
/**
 * Loads the theme styles & scripts.
 *
 * @since 1.0.0
 * @link  http://codex.wordpress.org/Function_Reference/wp_enqueue_script
 * @link  http://codex.wordpress.org/Function_Reference/wp_enqueue_style
 */
function satu_enqueue()
{
    // Add custom fonts, used in the main stylesheet.
    wp_enqueue_style('satu-fonts', satu_fonts_url(), array(), null);
    // if is not a child theme and WP_DEBUG and/or SCRIPT_DEBUG turned on, load the unminified styles & script.
    if (!is_child_theme() && WP_DEBUG || SCRIPT_DEBUG) {
        // Load main stylesheet
        wp_enqueue_style('satu-style', get_stylesheet_uri(), array('dashicons'));
        // Load custom js plugins.
        wp_enqueue_script('satu-plugins', trailingslashit(get_template_directory_uri()) . 'assets/js/plugins.min.js', array('jquery'), null, true);
        // Load custom js methods.
        wp_enqueue_script('satu-main', trailingslashit(get_template_directory_uri()) . 'assets/js/main.js', array('jquery'), null, true);
        // Load js function for responsive navigation.
        wp_enqueue_script('satu-mobile-nav', trailingslashit(get_template_directory_uri()) . 'assets/js/navigation.js', array(), null, true);
    } else {
        // Load main stylesheet
        wp_enqueue_style('satu-style', trailingslashit(get_template_directory_uri()) . 'style.min.css', array('dashicons'));
        // Load custom js plugins.
        wp_enqueue_script('satu-scripts', trailingslashit(get_template_directory_uri()) . 'assets/js/satu.min.js', array('jquery'), null, true);
        // Load js function for responsive navigation.
        wp_enqueue_script('satu-mobile-nav', trailingslashit(get_template_directory_uri()) . 'assets/js/navigation.js', array(), null, true);
    }
    // If child theme is active, load the stylesheet.
    if (is_child_theme()) {
        wp_enqueue_style('satu-child-style', get_stylesheet_uri());
    }
    // Load comment-reply script.
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Loads HTML5 Shiv
    wp_enqueue_script('standard-html5', trailingslashit(get_template_directory_uri()) . 'assets/js/html5shiv.min.js', array('jquery'), null, false);
    wp_script_add_data('standard-html5', 'conditional', 'lte IE 9');
}
Ejemplo n.º 2
0
/**
 * Enqueue scripts and stylesheets
 *
 * Enqueue stylesheets in the following order:
 * 1. /theme/assets/css/bootstrap.css
 * 2. /theme/assets/css/bootstrap-responsive.css
 * 3. /theme/assets/css/virtue.css
 * 4. /theme/assets/css/skin.css
 *
 * Enqueue scripts in the following order:
 * 1. jquery-1.9.1.min.js via Google CDN
 * 2. /theme/assets/js/vendor/modernizr-2.6.2.min.js
 * 3. /theme/assets/js/plugins.js (in footer)
 * 4. /theme/assets/js/main.js    (in footer)
 */
function kadence_scripts()
{
    wp_enqueue_style('kadence_bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css', false, "204");
    wp_enqueue_style('kadence_theme', get_template_directory_uri() . '/assets/css/virtue.css', false, "204");
    global $virtue;
    if (isset($virtue['skin_stylesheet'])) {
        $skin = $virtue['skin_stylesheet'];
    } else {
        $skin = 'default.css';
    }
    wp_enqueue_style('virtue_skin', get_template_directory_uri() . '/assets/css/skins/' . $skin . '', false, null);
    if (is_child_theme()) {
        wp_enqueue_style('roots_child', get_stylesheet_uri(), false, null);
    }
    if (is_single() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_register_script('modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr-2.6.2.min.js', false, null, false);
    wp_register_script('kadence_plugins', get_template_directory_uri() . '/assets/js/plugins.js', false, '200', true);
    wp_register_script('kadence_main', get_template_directory_uri() . '/assets/js/main.js', false, null, true);
    wp_enqueue_script('jquery');
    wp_enqueue_script('modernizr');
    wp_enqueue_script('kadence_plugins');
    wp_enqueue_script('kadence_main');
    if (class_exists('woocommerce')) {
        wp_deregister_script('wc-add-to-cart-variation');
        wp_register_script('wc-add-to-cart-variation', get_template_directory_uri() . '/assets/js/add-to-cart-variation-ck.js', array('jquery'), false, '200', true);
        wp_localize_script('wc-add-to-cart-variation', 'wc_add_to_cart_variation_params', apply_filters('wc_add_to_cart_variation_params', array('i18n_no_matching_variations_text' => esc_attr__('Sorry, no products matched your selection. Please choose a different combination.', 'woocommerce'), 'i18n_unavailable_text' => esc_attr__('Sorry, this product is unavailable. Please choose a different combination.', 'woocommerce'))));
        wp_enqueue_script('wc-add-to-cart-variation');
    }
}
Ejemplo n.º 3
0
/**
 * Activates default theme features.
 *
 * @since 1.6.0
 */
function genesis_theme_support()
{
    add_theme_support('menus');
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
    add_theme_support('genesis-inpost-layouts');
    add_theme_support('genesis-archive-layouts');
    add_theme_support('genesis-admin-menu');
    add_theme_support('genesis-seo-settings-menu');
    add_theme_support('genesis-import-export-menu');
    add_theme_support('genesis-readme-menu');
    add_theme_support('genesis-auto-updates');
    add_theme_support('genesis-breadcrumbs');
    //* Maybe add support for Genesis menus
    if (!current_theme_supports('genesis-menus')) {
        add_theme_support('genesis-menus', array('primary' => __('Primary Navigation Menu', 'genesis'), 'secondary' => __('Secondary Navigation Menu', 'genesis')));
    }
    //* Maybe add support for structural wraps
    if (!current_theme_supports('genesis-structural-wraps')) {
        add_theme_support('genesis-structural-wraps', array('header', 'menu-primary', 'menu-secondary', 'footer-widgets', 'footer'));
    }
    //* Turn on HTML5, responsive viewport & footer widgets if Genesis is active
    if (!is_child_theme()) {
        add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption'));
        add_theme_support('genesis-responsive-viewport');
        add_theme_support('genesis-footer-widgets', 3);
    }
}
/**
 * Load theme compat file if it exists.
 */
function jetpack_load_theme_compat()
{
    /**
     * Filter theme compat files.
     *
     * Themes can add their own compat files here if they like. For example:
     *
     * add_filter( 'jetpack_theme_compat_files', 'mytheme_jetpack_compat_file' );
     * function mytheme_jetpack_compat_file( $files ) {
     *     $files['mytheme'] = locate_template( 'jetpack-compat.php' );
     *     return $files;
     * }
     *
     * @module theme-tools
     *
     * @since 2.8.0
     *
     * @param array Associative array of theme compat files to load.
     */
    $compat_files = apply_filters('jetpack_theme_compat_files', array('twentyfourteen' => JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentyfourteen.php', 'twentyfifteen' => JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentyfifteen.php'));
    _jetpack_require_compat_file(get_stylesheet(), $compat_files);
    if (is_child_theme()) {
        _jetpack_require_compat_file(get_template(), $compat_files);
    }
}
Ejemplo n.º 5
0
 function get_section_dirs()
 {
     $section_dirs = array();
     $theme_sections_dir = PL_CHILD_DIR . '/sections';
     // if we are a child theme
     if (is_child_theme() && is_dir($theme_sections_dir)) {
         $section_dirs['custom'] = $theme_sections_dir;
     }
     // if we are a nested theme, register the theme sections folder
     if (defined('DMS_CORE') && is_dir(PL_THEME_DIR . '/sections')) {
         $section_dirs['theme'] = PL_THEME_DIR . '/sections';
     }
     // load sections that might be in plugins.
     include_once ABSPATH . 'wp-admin/includes/plugin.php';
     foreach (get_plugins() as $plugin => $data) {
         $slug = dirname($plugin);
         $path = path_join(WP_PLUGIN_DIR, "{$slug}/sections");
         if (is_dir($path) && is_plugin_active($plugin)) {
             $section_dirs[$slug] = $path;
         }
     }
     // include the core sections
     $section_dirs['parent'] = PL_SECTIONS;
     // deprecated, this was the sections plugin
     //$section_dirs['child'] = PL_EXTEND_DIR;
     return apply_filters('pagelines_sections_dirs', $section_dirs);
 }
Ejemplo n.º 6
0
/**
 * Scripts and stylesheets
 *
 * Enqueue stylesheets in the following order:
 * 1. /theme/assets/css/bootstrap.css
 * 2. /theme/assets/css/bootstrap-responsive.css
 * 3. /theme/assets/css/app.css
 * 4. /child-theme/style.css (if a child theme is activated)
 *
 * Enqueue scripts in the following order:
 * 1. /theme/assets/js/vendor/modernizr-2.6.2.min.js  (in head.php)
 * 2. jquery-1.8.0.min.js via Google CDN              (in head.php)
 * 3. /theme/assets/js/plugins.js
 * 4. /theme/assets/js/main.js
 */

function studiofolio_scripts() {
  global $data;
  wp_enqueue_style('studiofolio_bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css', false, null);
  wp_enqueue_style('studiofolio_bootstrap_responsive', get_template_directory_uri() . '/assets/css/responsive.css', array('studiofolio_bootstrap'), null);
  $stylesheet = (isset($data['alt_stylesheet']) && $data['alt_stylesheet']) ? $data['alt_stylesheet'] : 'light.css';
  wp_enqueue_style('studiofolio_app', get_template_directory_uri() . '/assets/css/'.$stylesheet, false, null);
  wp_enqueue_style('fresco', get_template_directory_uri() . '/assets/css/fresco.css', false, null);
  wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Lato:300,400,700');
  wp_enqueue_style( 'googleFonts');

  // Load style.css from child theme
  if (is_child_theme()) {
    wp_enqueue_style('studiofolio_child', get_stylesheet_uri(), false, null);
  }

  // jQuery is loaded in header.php using the same method from HTML5 Boilerplate:
  // Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline
  // It's kept in the header instead of footer to avoid conflicts with plugins.
  if (is_admin()) {
    wp_deregister_script('jquery');
    //wp_register_script('jquery', get_template_directory_uri() . '/assets/js/vendor/jquery-1.8.0.min.js', false, null, false);
  }

  if (is_single() && comments_open() && get_option('thread_comments')) {
    wp_enqueue_script('comment-reply');
  }

  wp_register_script('studiofolio_modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr-2.6.2.min.js', false, null, false);
  wp_register_script('studiofolio_plugins', get_template_directory_uri() . '/assets/js/plugins.js', false, null, false);
  wp_register_script('studiofolio_main', get_template_directory_uri() . '/assets/js/main.js', false, null, false);
  wp_enqueue_script("jquery");
  wp_enqueue_script('studiofolio_modernizr');
  wp_enqueue_script('studiofolio_plugins');
  wp_enqueue_script('studiofolio_main');
}
function ubuntucommunity_scripts()
{
    // Eric Meyer: CSS reset | http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
    wp_enqueue_style('css-reset', get_template_directory_uri() . '/css/reset.css');
    // Main style sheets
    wp_enqueue_style('ubuntucommunity-style-common', get_template_directory_uri() . '/css/style-common.css', array('css-reset'));
    wp_enqueue_style('ubuntucommunity-style', get_template_directory_uri() . '/css/style.css', array('css-reset'));
    // Dark variant
    if (get_theme_mod('ubuntucommunity_darkvariant') == true) {
        wp_enqueue_style('ubuntucommunity-style-dark', get_template_directory_uri() . '/css/style-dark.css', array('ubuntucommunity-style'));
    }
    // Font stylesheets
    wp_enqueue_style('font-ubuntu', get_template_directory_uri() . '/css/style-font-ubuntu.css');
    // Responsive design
    wp_enqueue_style('ubuntucommunity-style-resp-1000', get_template_directory_uri() . '/css/style-resp-1000.css', array('ubuntucommunity-style'), null, 'only screen and (max-width:1000px)');
    wp_enqueue_style('ubuntucommunity-style-resp-800', get_template_directory_uri() . '/css/style-resp-800.css', array('ubuntucommunity-style-resp-1000'), null, 'only screen and (max-width:800px)');
    wp_enqueue_style('ubuntucommunity-style-resp-menu-small', get_template_directory_uri() . '/css/style-resp-menu-small.css', array('ubuntucommunity-style-resp-800'), null, 'only screen and (max-width:800px)');
    wp_enqueue_style('ubuntucommunity-style-resp-640', get_template_directory_uri() . '/css/style-resp-640.css', array('ubuntucommunity-style-resp-800'), null, 'only screen and (max-width:640px)');
    wp_enqueue_style('ubuntucommunity-style-resp-menu-tiny', get_template_directory_uri() . '/css/style-resp-menu-tiny.css', array('ubuntucommunity-style-resp-64'), null, 'only screen and (max-width:640px)');
    // JS
    wp_enqueue_script('ubuntucommunity-js-menu', get_template_directory_uri() . '/js/menu.js', array('jquery'), '1');
    wp_localize_script('ubuntucommunity-js-menu', 'ubuntucommunity', array('theme_url' => get_template_directory_uri()));
    // If a child theme is in use, this loads the child themes main CSS file
    if (is_child_theme()) {
        wp_enqueue_style('ubuntucommunity-child-style', get_stylesheet_directory_uri() . '/style.css', array('ubuntucommunity-style'));
    }
}
Ejemplo n.º 8
0
/**
 * Enqueue scripts and stylesheets
 *
 * Enqueue stylesheets in the following order:
 * 1. /theme/assets/css/bootstrap.css
 * 2. /theme/assets/css/bootstrap-responsive.css
 * 3. /theme/assets/css/app.css
 * 4. /child-theme/style.css (if a child theme is activated)
 *
 * Enqueue scripts in the following order:
 * 1. jquery-1.9.1.min.js via Google CDN
 * 2. /theme/assets/js/vendor/modernizr-2.6.2.min.js
 * 3. /theme/assets/js/plugins.js (in footer)
 * 4. /theme/assets/js/main.js    (in footer)
 */
function roots_scripts()
{
    wp_enqueue_style('roots_bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css', false, null);
    wp_enqueue_style('roots_bootstrap_responsive', get_template_directory_uri() . '/assets/css/bootstrap-responsive.css', array('roots_bootstrap'), null);
    //  wp_enqueue_style('roots_darkstrap', get_template_directory_uri() . '/assets/css/darkstrap.css', false, null);
    wp_enqueue_style('roots_app', get_template_directory_uri() . '/assets/css/app.css', false, null);
    // Load style.css from child theme
    if (is_child_theme()) {
        wp_enqueue_style('roots_child', get_stylesheet_uri(), false, null);
    }
    // jQuery is loaded using the same method from HTML5 Boilerplate:
    // Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline
    // It's kept in the header instead of footer to avoid conflicts with plugins.
    if (!is_admin() && current_theme_supports('jquery-cdn')) {
        wp_deregister_script('jquery');
        wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', false, null, false);
        add_filter('script_loader_src', 'roots_jquery_local_fallback', 10, 2);
    }
    if (is_single() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_register_script('modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr-2.6.2.min.js', false, null, false);
    wp_register_script('roots_plugins', get_template_directory_uri() . '/assets/js/plugins.js', false, null, true);
    wp_register_script('roots_main', get_template_directory_uri() . '/assets/js/main.js', false, null, true);
    wp_enqueue_script('jquery');
    wp_enqueue_script('modernizr');
    wp_enqueue_script('roots_plugins');
    wp_enqueue_script('roots_main');
}
 /**
  * Setup theme constants.
  *
  * @access private
  * @since 1.0
  * @return void
  */
 private function setup_constants()
 {
     define('STAG_CUSTOMIZER_VERSION', $this->version);
     if (function_exists('wp_get_theme')) {
         if (is_child_theme()) {
             $temp_obj = wp_get_theme();
             $theme_obj = wp_get_theme($temp_obj->get('Template'));
         } else {
             $theme_obj = wp_get_theme();
         }
         $theme_version = $theme_obj->get('Version');
         $theme_name = $theme_obj->get('Name');
         $theme_uri = $theme_obj->get('ThemeURI');
         $theme_author = $theme_obj->get('Author');
         $theme_author_uri = $theme_obj->get('AuthorURI');
     }
     define('STAG_THEME_NAME', $theme_name);
     define('STAG_THEME_VERSION', $theme_version);
     define('STAG_THEME_URI', $theme_uri);
     define('STAG_THEME_AUTHOR', $theme_author);
     define('STAG_THEME_AUTHOR_URI', $theme_author_uri);
     /**
      * The suffix to use for scripts.
      */
     if (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) {
         define('STAG_SCRIPT_SUFFIX', '');
     } else {
         define('STAG_SCRIPT_SUFFIX', '.min');
     }
 }
Ejemplo n.º 10
0
function italystrap_pointer_print_scripts()
{
    $pointer_content = '<h3>' . __('Welcome to the ItalyStrap theme', 'ItalyStrap') . '</h3>';
    if (!is_child_theme()) {
        $pointer_content .= '<p>' . __('First off all install <a href="https://github.com/overclokk/ItalyStrap-child" target="_blank">ItalyStrap-child</a> and use it for any customization.', 'ItalyStrap') . '</p><p>' . __('Also read the Wiki <a href="https://github.com/overclokk/ItalyStrap-child/wiki/How-to-use-Child-Theme" target="_blank">How to use Child Theme</a>', 'ItalyStrap') . '</p>';
    }
    ?>
 
    <script type="text/javascript">
    //<![CDATA[
    jQuery(document).ready( function($) {
        $('#menu-appearance').pointer({
            content:        '<?php 
    echo $pointer_content;
    ?>
',
            position:        {
                                edge:    'left', // arrow direction
                                align:    'center' // vertical alignment
                            },
            pointerWidth:    350,
            close:            function() {
                                $.post( ajaxurl, {
                                        pointer: 'italystrap_settings_pointer', // pointer ID
                                        action: 'dismiss-wp-pointer'
                                });
                            }
        }).pointer('open');
    });
    //]]>
    </script>
 
<?php 
}
/**
 * Add the Framework to the menu
 */
function zilla_menu()
{
    $zilla_options = get_option('zilla_framework_options');
    $icon = ZILLA_URL . '/images/favicon.png';
    // Theme Options page
    add_object_page($zilla_options['theme_name'], $zilla_options['theme_name'], 'update_core', 'zillaframework', 'zilla_options_page', $icon);
    add_submenu_page('zillaframework', __('Theme Options', 'zilla'), __('Theme Options', 'zilla'), 'update_core', 'zillaframework', 'zilla_options_page');
    // Update Theme page
    $menu_title = __('Theme Updates', 'zilla');
    if ($xml = zilla_get_theme_changelog()) {
        $theme_version = '';
        if (function_exists('wp_get_theme')) {
            if (is_child_theme()) {
                $temp_obj = wp_get_theme();
                $theme_obj = wp_get_theme($temp_obj->get('Template'));
            } else {
                $theme_obj = wp_get_theme();
            }
            $theme_version = $theme_obj->get('Version');
        } else {
            $template_path = get_template_directory();
            $theme_data = get_theme_data($template_path . '/style.css');
            $theme_version = $theme_data['Version'];
        }
        if (version_compare($theme_version, $xml->latest) == -1) {
            $menu_title = __('Theme Updates <span class="update-plugins count-1"><span class="update-count">1</span></span>', 'zilla');
        }
    }
    add_submenu_page('zillaframework', __('Theme Updates', 'zilla'), $menu_title, 'update_core', 'zillaframework-update', 'zilla_update_page');
    // Theme Collection page
    add_submenu_page('zillaframework', __('More Themes', 'zilla'), __('More Themes', 'zilla'), 'update_core', 'zillaframework-themes', 'zilla_themes_page');
    // Support link/page
    add_submenu_page('zillaframework', __('Support Forums', 'zilla'), __('Support Forums', 'zilla'), 'update_core', 'zillaframework-support', 'zilla_support_page');
}
Ejemplo n.º 12
0
 /**
  * An array of paths containing our twig files.
  * First we search in the childtheme if one is active.
  * Then we continue looking for the twig file in the active shell
  * and finally fallback to the core twig files.
  */
 public function twig_locations()
 {
     $locations = array();
     $location_roots = array();
     // Are we using a child theme?
     // If yes, then first look in there.
     if (is_child_theme()) {
         $location_roots[] = get_stylesheet_directory();
     }
     // Active shell
     $location_roots[] = MAERA_SHELL_PATH;
     // Core twig locations.
     $location_roots[] = get_template_directory();
     // Allow modifying they location roots using a filter
     $location_roots = apply_filters('maera/timber/locations/roots', $location_roots);
     foreach ($location_roots as $location_root) {
         if (class_exists('Easy_Digital_Downloads')) {
             $locations[] = $location_root . '/views/edd';
         }
         if (class_exists('WooCommerce')) {
             $locations[] = $location_root . '/views/woocommerce';
         }
         $locations[] = $location_root . '/macros';
         $locations[] = $location_root . '/views/macros';
         $locations[] = $location_root . '/views';
         $locations[] = $location_root;
     }
     return apply_filters('maera/timber/locations', $locations);
 }
Ejemplo n.º 13
0
/**
 * Enqueue scripts and stylesheets
 *
 */
function ya_scripts()
{
    // register styles
    // wp_register_style('bootstrap_css', get_template_directory_uri() . '/assets/css/bootstrap.min.css', false, null);
    // wp_register_style('fonticons_css', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array('bootstrap_css'), null);
    //wp_register_style('bootstrap_gallery_css', get_template_directory_uri() . '/assets/css/bootstrap-image-gallery.css', array(), null);
    $scheme = ya_options()->getCpanelValue('scheme');
    if ($scheme) {
        $app_css = get_template_directory_uri() . '/assets/css/app-' . $scheme . '.css';
    } else {
        $app_css = get_template_directory_uri() . '/assets/css/app-default.css';
    }
    wp_register_style('ya_photobox_css', get_template_directory_uri() . '/assets/css/photobox.css', array(), null);
    wp_register_style('layout_css', get_template_directory_uri() . '/assets/css/isotope.css', array(), null);
    wp_register_style('yatheme_css', $app_css, array(), null);
    wp_register_style('flexslider_css', get_template_directory_uri() . '/assets/css/flexslider.css', array(), null);
    wp_register_style('lightbox_css', get_template_directory_uri() . '/assets/css/jquery.fancybox.css', array(), null);
    wp_register_style('yatheme_responsive_css', get_template_directory_uri() . '/assets/css/app-responsive.css', array('yatheme_css'), null);
    // register script
    wp_register_script('modernizr', get_template_directory_uri() . '/assets/js/modernizr-2.6.2.min.js', false, null, false);
    wp_register_script('bootstrap_js', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery'), null, true);
    wp_register_script('gallery_load_js', get_template_directory_uri() . '/assets/js/load-image.min.js', array('bootstrap_js'), null, true);
    wp_register_script('bootstrap_gallery_js', get_template_directory_uri() . '/assets/js/bootstrap-image-gallery.min.js', array('gallery_load_js'), null, true);
    wp_register_script('flexslider_js', get_template_directory_uri() . '/assets/js/jquery.flexslider-min.js', array('jquery'), null, true);
    wp_register_script('photobox_js', get_template_directory_uri() . '/assets/js/photobox.js', array('jquery'), null, true);
    wp_register_script('plugins_js', get_template_directory_uri() . '/assets/js/plugins.js', array('jquery'), null, true);
    wp_register_script('layout_js', get_template_directory_uri() . '/assets/js/isotope.min.js', array('jquery'), null, false);
    wp_register_script('lightbox_js', get_template_directory_uri() . '/assets/js/jquery.fancybox.pack.js', array('jquery'), null, false);
    wp_register_script('yatheme_js', get_template_directory_uri() . '/assets/js/main.js', array('bootstrap_js', 'plugins_js'), null, true);
    // enqueue script & style
    if (!is_admin()) {
        wp_enqueue_script('lightbox_js');
        wp_enqueue_style('yatheme_css');
        wp_enqueue_style('lightbox_css');
        wp_enqueue_script('flexslider_js');
        wp_enqueue_style('flexslider_css');
        if (ya_options()->getCpanelValue('responsive_support')) {
            //	wp_enqueue_style('bootstrap_responsive_css');
            wp_enqueue_style('yatheme_responsive_css');
        }
        // is_rtl() && wp_enqueue_style('bootstrap_rtl_css');
        // Load style.css from child theme
        if (is_child_theme()) {
            wp_enqueue_style('yatheme_child_css', get_stylesheet_uri(), false, null);
        }
    }
    if (is_single() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    if (is_tax('product_cat') || is_post_type_archive('product')) {
        wp_enqueue_script('layout_js');
        wp_enqueue_style('layout_css');
    }
    $is_category = is_category() && !is_category('blog');
    if (!is_admin()) {
        wp_enqueue_script('modernizr');
        wp_enqueue_script('yatheme_js');
        wp_enqueue_script('pie_js');
    }
}
Ejemplo n.º 14
0
 function widget($args, $instance)
 {
     $html = '';
     extract($args, EXTR_SKIP);
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Display the widget title if one was input (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // End IF Statement
     /* Widget content. */
     // Add actions for plugins/themes to hook onto.
     do_action('widget_woo_search_top');
     // Load the search form.
     if (function_exists('get_template_part')) {
         get_template_part('search', 'form');
     } else {
         // If we're in an older version of WordPress, cater for child theme files.
         $search_file = '/search-form.php';
         $search_file_path = get_template_directory() . $search_file;
         if (is_child_theme() && file_exists(get_stylesheet_directory() . $search_file)) {
             $search_file_path = get_stylesheet_directory() . $search_file;
         }
         include $search_file_path;
     }
     // Add actions for plugins/themes to hook onto.
     do_action('widget_woo_search_bottom');
     /* After widget (defined by themes). */
     echo $after_widget;
 }
 /**
  * Section install tab.
  *
  */
 function extension_sections($tab = '', $mode = 'install')
 {
     if ($tab == 'child' && !is_child_theme()) {
         return $this->ui->extension_banner(__('A PageLines child theme is not currently activated', 'pagelines'));
     }
     if (!$this->has_extend_plugin()) {
         return $this->ui->get_extend_plugin($this->has_extend_plugin('status'), $tab);
     }
     $list = array();
     $type = 'section';
     if ('install' == $mode) {
         $sections = $this->get_latest_cached('sections');
         if (!is_object($sections)) {
             return $sections;
         }
         $sections = pagelines_store_object_sort($sections);
         $list = $this->get_master_list($sections, $type, $tab);
     }
     // end install mode
     if ('installed' == $mode) {
         global $load_sections;
         // Get sections
         $available = $load_sections->pagelines_register_sections(true, true);
         $disabled = get_option('pagelines_sections_disabled', array());
         $upgradable = $this->get_latest_cached('sections');
         foreach ($available as $key => $section) {
             $available[$key] = self::sort_status($section, $disabled, $available, $upgradable);
         }
         $sections = self::merge_sections($available);
         $this->updates_list(array('list' => $sections, 'type' => 'section'));
         $list = $this->get_master_list($sections, $type, $tab, 'installed');
     }
     // end installed mode
     return $this->ui->extension_list(array('list' => $list, 'tab' => $tab, 'type' => 'sections'));
 }
Ejemplo n.º 16
0
/**
 * Scripts and stylesheets
 *
 * Enqueue stylesheets in the following order:
 * 1. /theme/css/bootstrap.css
 * 2. /theme/css/bootstrap-responsive.css      (if enabled in config.php)
 * 3. /theme/css/app.css
 * 4. /child-theme/style.css                   (if a child theme is activated)
 *
 * Enqueue scripts in the following order:
 * 1. /theme/js/vendor/modernizr-2.5.3.min.js  (in header.php)
 * 2. jquery-1.7.2.min.js via Google CDN       (in header.php)
 * 3. /theme/js/plugins.js
 * 4. /theme/js/main.js
 */
function roots_scripts()
{
    wp_enqueue_style('galleryview_css', get_template_directory_uri() . '/css/jquery.galleryview-3.0-dev.css', false, null);
    wp_enqueue_style('lightSlider_css', get_template_directory_uri() . '/css/vendor/lightSlider.css', false, null);
    // If you're not using Bootstrap, include HTML5 Boilerplate's main.css:
    // wp_enqueue_style('roots_h5bp', get_template_directory_uri() . '/css/main.css', false, null);
    wp_enqueue_style('roots_app', get_template_directory_uri() . '/css/app.css', false, "1425333448");
    // Load style.css from child theme
    if (is_child_theme()) {
        wp_enqueue_style('roots_child', get_stylesheet_uri(), false, null);
    }
    // jQuery is loaded in header.php using the same method from HTML5 Boilerplate:
    // Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline
    // It's kept in the header instead of footer to avoid conflicts with plugins.
    if (!is_admin()) {
        wp_deregister_script('jquery');
        wp_register_script('jquery', '', '', '', false);
    }
    if (is_single() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_register_script('roots_plugins', get_template_directory_uri() . '/js/plugins.js', false, null, false);
    wp_register_script('roots_main', get_template_directory_uri() . '/js/main.js', false, null, false);
    wp_register_script('galleryview_main', get_template_directory_uri() . '/js/vendor/jquery.galleryview-3.0-dev.js', false, null, false);
    wp_register_script('galleryview_easing', get_template_directory_uri() . '/js/vendor/jquery.easing.1.3.js', false, null, false);
    wp_register_script('galleryview_timers', get_template_directory_uri() . '/js/vendor/jquery.timers-1.2.js', false, null, false);
    wp_enqueue_script('roots_plugins');
    wp_enqueue_script('roots_main');
    wp_enqueue_script('galleryview_main');
    wp_enqueue_script('galleryview_easing');
    wp_enqueue_script('galleryview_timers');
}
Ejemplo n.º 17
0
function dtheme_startup()
{
    global $dt_revealData, $krypton_Scripts, $krypton_config;
    $dt_revealData = array();
    $krypton_Scripts = array();
    $theme_name = get_template();
    $locale = get_locale();
    $localelanguage = get_template_directory() . '/languages';
    if (is_child_theme() && !load_textdomain('Krypton', untrailingslashit(get_stylesheet_directory()) . "/{$locale}.mo") || !is_child_theme() && !load_theme_textdomain('Krypton', get_template_directory())) {
        $aaa = load_theme_textdomain('Krypton', $localelanguage);
    }
    // Add post thumbnail supports. http://codex.wordpress.org/Post_Thumbnails
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
    add_theme_support('menus');
    add_theme_support('woocommerce');
    add_theme_support('title-tag');
    register_nav_menus(array('primary' => __('Top Navigation', 'Krypton'), 'footer_navigation' => __('Footer Navigation', 'Krypton')));
    // sidebar widget
    register_sidebar(array('name' => 'Sidebar', 'id' => 'krypton-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => 'Bottom Widget', 'id' => 'krypton-bottom', 'description' => __('Bottom Widget Area. Recomended 3 widgets', 'Krypton'), 'before_widget' => '<div class="col-lg-4 col-md-4 col-sm-4 clearfix"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="row"><div class="section-head"><header class="col col-sm-12 centered"><h2>', 'after_title' => '</h2><hr></header></div></div>'));
    register_sidebar(array('name' => 'Contact Page Sidebar', 'id' => 'krypton-contact-sidebar', 'description' => __('Widget area for contact page', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    if (is_plugin_active('woocommerce/woocommerce.php')) {
        register_sidebar(array('name' => 'Shop Sidebar', 'id' => 'shop-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
        register_sidebar(array('name' => 'Shop Bottom ', 'id' => 'shop-bottom', 'description' => __('Shop Bottom Widget Area. Displayed at shop pages', 'Krypton'), 'before_widget' => '<div class="col-md-3 col-sm-6"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
    }
    add_action('wp_enqueue_scripts', 'dt_enqueue_color_scheme');
    add_action('wp_enqueue_scripts', 'dtheme_scripts', 999);
    add_action('wp_print_scripts', 'dtheme_register_var', 998);
    add_action('wp_print_scripts', 'detheme_print_inline_style');
    add_action('wp_footer', 'dtheme_register_mainmenu', 997);
    add_action('wp_enqueue_scripts', 'dtheme_css_style', 999);
    add_action('wp_footer', create_function('', 'global $krypton_Scripts;if(count($krypton_Scripts)) print "<script type=\\"text/javascript\\">\\n".@implode("\\n",$krypton_Scripts)."\\n</script>\\n";'), 99998);
}
 /**
  * Adds a parameter of the last modified time to all editor stylesheets.
  *
  * @wp-hook mce_css
  * @param  string $css Comma separated stylesheet URIs
  * @return string
  */
 function t5_fresh_editor_style($css)
 {
     global $editor_styles;
     if (empty($css) or empty($editor_styles)) {
         return $css;
     }
     // Modified copy of _WP_Editors::editor_settings()
     $mce_css = array();
     $style_uri = get_stylesheet_directory_uri();
     $style_dir = get_stylesheet_directory();
     if (is_child_theme()) {
         $template_uri = get_template_directory_uri();
         $template_dir = get_template_directory();
         foreach ($editor_styles as $key => $file) {
             if ($file && file_exists("{$template_dir}/{$file}")) {
                 $mce_css[] = add_query_arg('version', filemtime("{$template_dir}/{$file}"), "{$template_uri}/{$file}");
             }
         }
     }
     foreach ($editor_styles as $file) {
         if ($file && file_exists("{$style_dir}/{$file}")) {
             $mce_css[] = add_query_arg('version', filemtime("{$style_dir}/{$file}"), "{$style_uri}/{$file}");
         }
     }
     return implode(',', $mce_css);
 }
Ejemplo n.º 19
0
    function devtheme_load_styles()
    {
        global $theme_version, $bp_existed;
        wp_enqueue_style('dev-base', get_template_directory_uri() . '/lib/css/base.css', array(), $theme_version);
        if ($bp_existed) {
            wp_enqueue_style('dev-bp-base', get_template_directory_uri() . '/_inc/css/bp-default.css', array('dev-base'), $theme_version);
            wp_enqueue_style('dev-bp-css', get_template_directory_uri() . '/lib/css/bp-css.css', array('dev-base'), $theme_version);
            wp_enqueue_style('dev-bp-adminbar', get_template_directory_uri() . '/_inc/css/adminbar.css', array('dev-base'), $theme_version);
        }
        /*if( is_rtl() ):
        wp_enqueue_style( 'dev-rtl', get_template_directory_uri() . '/lib/css/rtl.css', array( 'dev-base' ), $theme_version );
        endif;*/
        if (file_exists(TEMPLATEPATH . '/lib/css/custom.css')) {
            wp_enqueue_style('dev-custom', get_template_directory_uri() . '/lib/css/custom.css', array('dev-base'), $theme_version);
        }
        // If the current theme is a child theme, enqueue its stylesheet
        if (is_child_theme() && 'wpmu-nelo' == get_template()) {
            if (file_exists(STYLESHEETPATH . '/lib/css/child-style.css')) {
                wp_enqueue_style('dev-base-child', get_stylesheet_directory_uri() . '/lib/css/child-style.css', array('dev-base'), $theme_version);
            }
        }
        ?>

<?php 
    }
Ejemplo n.º 20
0
/**
 * Render settings page
 */
function themify_base_page()
{
    if (!current_user_can('manage_options')) {
        wp_die(__('You do not have sufficient permissions to update this site.', 'themify'));
    }
    $theme = wp_get_theme();
    $theme_name = is_child_theme() ? $theme->parent()->Name : $theme->display('Name');
    ?>
	<h2><?php 
    printf(__('%s Settings', 'themify'), $theme_name);
    ?>
</h2>

	<form action="options.php" method="post">
		<?php 
    settings_fields('themify_settings');
    ?>
		<?php 
    do_settings_sections('themify');
    ?>
		<?php 
    submit_button();
    ?>
	</form>

	<?php 
}
Ejemplo n.º 21
0
function allurer_scripts()
{
    global $wp_styles;
    // Bump this when changes are made to bust cache
    $allurer_theme = wp_get_theme();
    $version = $allurer_theme->get('Version');
    // CSS Scripts
    // Add our fonts, used in the main stylesheet.
    wp_enqueue_style('allurer-fonts', allurer_font_url(), array(), null);
    wp_enqueue_style('allurer-style', get_template_directory_uri() . '/assets/css/style.css', false, $version, 'all');
    wp_enqueue_style('allurer-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css', false, $version, 'all');
    wp_enqueue_style('allurer-custom', get_template_directory_uri() . '/assets/css/custom.css', false, $version, 'all');
    wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/font-awesome/css/font-awesome.css', false, $version, 'all');
    // Load style.css from child theme
    if (is_child_theme()) {
        wp_enqueue_style('allurer-child', get_stylesheet_uri(), false, $version, null);
    }
    // Loads the Internet Explorer specific stylesheet.
    wp_enqueue_style('allurer-ie', get_template_directory_uri() . '/assets/css/ie.css', array('allurer-style'), $version);
    wp_style_add_data('allurer-ie', 'conditional', 'lt IE 8');
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_enqueue_script('bootstrap.js', get_template_directory_uri() . '/assets/js/bootstrap.js', array('jquery'), $version, true);
    wp_enqueue_script('allurer-custom-js', get_template_directory_uri() . '/assets/js/custom.js', array('jquery'), false, true);
    wp_enqueue_script('modernizr.js', get_template_directory_uri() . '/assets/js/modernizr.custom.79639.js', array('jquery'), $version, false);
    wp_enqueue_script('allurer-html5shiv', get_template_directory_uri() . '/js/html5.js', array(), '3.7.0', false);
}
Ejemplo n.º 22
0
 /**
  * alm_enqueue_css
  *
  * Load ALM CSS
  *
  * @since 2.10.1
  * @return wp_enqueue_style
  */
 public static function alm_enqueue_css($name, $file)
 {
     $css = '';
     $css_path = '';
     $dir = 'alm';
     $file_css = $name . '.css';
     // - Check theme for local ajax-load-more.css, if found, load that file
     if (is_child_theme()) {
         $css = get_stylesheet_directory_uri() . '/' . $dir . '/' . $file_css;
         $css_path = get_stylesheet_directory() . '/' . $dir . '/' . $file_css;
         // if child theme does not have CSS, check the parent theme
         if (!file_exists($css_path)) {
             $css = get_template_directory_uri() . '/' . $dir . '/' . $file_css;
             $css_path = get_template_directory() . '/' . $dir . '/' . $file_css;
         }
     } else {
         $css = get_template_directory_uri() . '/' . $dir . '/' . $file_css;
         $css_path = get_template_directory() . '/' . $dir . '/' . $file_css;
     }
     if ($css_path !== '') {
         // If $css_path has been
         if (file_exists($css_path)) {
             $file = $css;
         }
     }
     // Enqueue $file
     wp_enqueue_style($name, $file);
 }
Ejemplo n.º 23
0
 private static function load_from_extensions_recursive($extensions)
 {
     /*
      * Loop each extension
      * if it has a shortcodes folder load the shortcodes from it
      * if an extension has subextensions then recursion
      */
     foreach ($extensions as $ext_name => $children) {
         $extension = fw()->extensions->get($ext_name);
         $rel_path = $extension->get_rel_path();
         // framework
         $fw_path = fw_get_framework_directory('/extensions' . $rel_path . '/shortcodes');
         if (file_exists($fw_path)) {
             self::load_from_shortcodes_folder(array('path' => $fw_path, 'uri' => fw_get_framework_directory_uri('/extensions' . $rel_path . '/shortcodes')));
         }
         // parent theme framework-customizations
         $parent_fws_path = fw_get_template_customizations_directory('/extensions' . $rel_path . '/shortcodes');
         if (file_exists($parent_fws_path)) {
             self::load_from_shortcodes_folder(array('path' => $parent_fws_path, 'uri' => fw_get_template_customizations_directory_uri('/extensions' . $rel_path . '/shortcodes')));
         }
         // child theme framework-customizations
         if (is_child_theme()) {
             $child_fws_path = fw_get_stylesheet_customizations_directory('/extensions' . $rel_path . '/shortcodes');
             if (file_exists($child_fws_path)) {
                 self::load_from_shortcodes_folder(array('path' => $child_fws_path, 'uri' => fw_get_stylesheet_customizations_directory_uri('/extensions' . $rel_path . '/shortcodes')));
             }
         }
         if (!empty($children)) {
             self::load_from_extensions_recursive($children);
         }
     }
 }
Ejemplo n.º 24
0
 function skeleton_customizer_styles()
 {
     $theme = wp_get_theme();
     if (is_child_theme()) {
         $parent = $theme->parent();
         $version = $parent['Version'];
     } else {
         $version = $theme['Version'];
     }
     // Custom stylesheet overrides
     wp_enqueue_style('skeleton-custom', get_stylesheet_directory_uri() . '/custom.css', array(), $version, 'screen, projection');
     // Get Typography Options
     $body_font = str_replace("+", " ", skeleton_options('body_font', 'Sans-Serif'));
     $heading_font = str_replace("+", " ", skeleton_options('heading_font', 'Sans-Serif'));
     $protocol = is_ssl() ? 'https' : 'http';
     $body_query_args = array('family' => skeleton_options('body_font') . ':400,700');
     $heading_query_args = array('family' => skeleton_options('heading_font') . ':400,700');
     if ($body_font != 'Sans-Serif' && $body_font != 'Serif') {
         wp_enqueue_style('skeleton-body-fonts', add_query_arg($body_query_args, "{$protocol}://fonts.googleapis.com/css"), array(), null);
     }
     if ($heading_font != 'Sans-Serif' && $body_font != 'Serif') {
         wp_enqueue_style('skeleton-heading-fonts', add_query_arg($heading_query_args, "{$protocol}://fonts.googleapis.com/css"), array(), null);
     }
     $secondary_color = skeleton_options('secondary_color', '#BE3243');
     $primary_color = skeleton_options('primary_color', '#375199');
     $body_bg_color = skeleton_options('body_bg_color', '#f9f9f9');
     $body_text_color = skeleton_options('body_text_color', '#333333');
     $link_color = skeleton_options('link_color', '#3376ea');
     $link_hover_color = skeleton_options('link_hover_color', '#3376ea');
     $css = "\n\t\t\tbody {\n\t\t\t\tcolor: {$body_text_color};\n\t\t\t\tfont-family: {$body_font};\n\t\t\t\tbackground-color: {$body_bg_color};\n\t\t\t}\n\t\t\th1,h2,h3,h4,h5 {\n\t\t\t\tfont-family: {$heading_font};\n\t\t\t}\n\t\t\ta,a:visited {\n\t\t\t\tcolor: {$link_color};\n\t\t\t}\n\t\t\ta:hover, a:focus, a:active {\n\t\t\t\tcolor: {$link_hover_color};\n\t\t\t}\n\t\t\t#header h1#site-title a {\n\t\t\t\tcolor:{$primary_color};\n\t\t\t}\n\t\t\th3.widget-title,\n\t\t\t#header span.site-desc {\n\t\t\t\tcolor:{$secondary_color};\n\t\t\t}\n\t\t";
     wp_add_inline_style('skeleton-custom', $css);
 }
 function ci_load_widgets()
 {
     // The loading priority is depended on the $paths array.
     // For maximum flexibility, widgets are loaded in this order:
     // 1) Child theme specific widgets
     // 2) Child theme generic widgets
     // 3) Parent theme specific widgets
     // 4) Parent theme generic widgets
     $paths = array();
     if (is_child_theme()) {
         $paths[] = get_stylesheet_directory() . '/functions/widgets';
         $paths[] = get_stylesheet_directory() . '/panel/widgets';
     }
     $paths[] = get_template_directory() . '/functions/widgets';
     $paths[] = get_template_directory() . '/panel/widgets';
     foreach ($paths as $path) {
         if (is_readable($path) and $handle = opendir($path)) {
             while (false !== ($file = readdir($handle))) {
                 if ($file != "." && $file != "..") {
                     $file_info = pathinfo($path . '/' . $file);
                     if (empty($file_info['extension'])) {
                         continue;
                     }
                     if ($file_info['extension'] == 'php') {
                         require_once $path . '/' . $file;
                     }
                 }
             }
             closedir($handle);
         }
     }
 }
Ejemplo n.º 26
0
 function shoestrap_css($target = 'path', $echo = false)
 {
     global $blog_id;
     $defaultfile = '/assets/css/app';
     // If this is a multisite installation, append the blogid to the filename
     $cssid = is_multisite() && $blog_id > 1 ? '_id-' . $blog_id : null;
     $css_uri = get_template_directory_uri() . $defaultfile . $cssid . '.css';
     $css_path = get_template_directory() . $defaultfile . $cssid . '.css';
     if (!is_writable($css_path)) {
         $css_uri = get_template_directory_uri() . $defaultfile . '-default.css';
     }
     if (is_child_theme()) {
         $child_style = get_stylesheet_directory() . $defaultfile . $cssid . '.css';
         $child_style_writable = is_writable($child_style) ? true : false;
         if ($child_style_writable) {
             $css_path = $child_style;
             $css_url = get_stylesheet_directory_uri() . $defaultfile . $cssid . '.css';
             $css_uri = get_template_directory_uri() . $defaultfile . '-default.css';
         }
     }
     $return = $target == 'url' ? $css_uri : $css_path;
     if ($echo) {
         echo $return;
     } else {
         return $return;
     }
 }
Ejemplo n.º 27
0
/**
 * Run the Engine
 */
function calibrefx_initializing()
{
    global $calibrefx;
    $calibrefx = Calibrefx::get_instance();
    // Add theme support
    add_theme_support('html5', array('comment-list', 'comment-form', 'search-form'));
    add_theme_support('menus');
    add_theme_support('title-tag');
    add_theme_support('automatic-feed-links');
    add_theme_support('post-thumbnails');
    add_theme_support('post-formats', array('aside', 'status', 'image', 'video', 'audio', 'quote', 'link', 'gallery', 'chat'));
    if (is_child_theme()) {
        add_filter('calibrefx_helpers_to_include', 'childfx_load_extension', 10, 2);
        add_filter('calibrefx_shortcodes_to_include', 'childfx_load_extension', 15, 2);
        add_filter('calibrefx_hooks_to_include', 'childfx_load_extension', 20, 2);
        add_filter('calibrefx_widgets_to_include', 'childfx_load_extension', 25, 2);
        add_filter('calibrefx_library_path', 'childfx_load_library');
    }
    //Load every active module
    Calibrefx::load_modules();
    /*
     * This theme styles the visual editor to resemble the theme style,
     * specifically font, colors, icons, and column width.
     */
    add_editor_style(array('assets/css/editor-style.css', 'assets/css/cfxicons.css', 'assets/css/font-awesome.css', 'assets/css/genericons.css', calibrefx_fonts_url()));
    // Run the engine
    $calibrefx->run();
    /** Run the calibrefx_post_init hook */
    do_action('calibrefx_post_init');
}
Ejemplo n.º 28
0
/**
 * Scripts and stylesheets
 *
 * Enqueue stylesheets in the following order:
 * 1. /theme/assets/css/bootstrap.css
 * 2. /theme/assets/css/bootstrap-responsive.css
 * 3. /theme/assets/css/app.css
 * 4. /child-theme/style.css (if a child theme is activated)
 *
 * Enqueue scripts in the following order:
 * 1. /theme/assets/js/vendor/modernizr-2.6.2.min.js  (in head.php)
 * 2. jquery-1.8.2.min.js via Google CDN              (in head.php)
 * 3. /theme/assets/js/plugins.js
 * 4. /theme/assets/js/main.js
 */
function shoestrap_scripts()
{
    $shoestrap_responsive = get_theme_mod('shoestrap_responsive');
    if ($shoestrap_responsive == '0') {
        wp_enqueue_style('shoestrap_app', get_template_directory_uri() . '/assets/css/app-fixed.css', false, null);
    } else {
        wp_enqueue_style('shoestrap_app', get_template_directory_uri() . '/assets/css/app-responsive.css', false, null);
    }
    // Load style.css from child theme
    if (is_child_theme()) {
        wp_enqueue_style('shoestrap_child', get_stylesheet_uri(), false, null);
    }
    // jQuery is loaded in header.php using the same method from HTML5 Boilerplate:
    // Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline
    // It's kept in the header instead of footer to avoid conflicts with plugins.
    if (!is_admin()) {
        wp_deregister_script('jquery');
        wp_register_script('jquery', '', '', '1.8.2', false);
    }
    if (is_single() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_register_script('shoestrap_plugins', get_template_directory_uri() . '/assets/js/plugins.js', false, null, false);
    wp_register_script('shoestrap_main', get_template_directory_uri() . '/assets/js/main.js', false, null, false);
    wp_enqueue_script('shoestrap_plugins');
    wp_enqueue_script('shoestrap_main');
}
Ejemplo n.º 29
0
function alm_get_default_repeater()
{
    global $wpdb;
    $file = null;
    $template_dir = 'alm_templates';
    // Allow user to load template from theme directory
    // Since 2.8.5
    // load repeater template from current theme folder
    if (is_child_theme()) {
        $template_theme_file = get_stylesheet_directory() . '/' . $template_dir . '/default.php';
        // if child theme does not have repeater template, then use the parent theme dir
        if (!file_exists($template_theme_file)) {
            $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php';
        }
    } else {
        $template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php';
    }
    // if theme or child theme contains the template, use that file
    if (file_exists($template_theme_file)) {
        $file = $template_theme_file;
    }
    // Since 2.0
    // otherwise use pre-defined plug-in templates
    if ($file == null) {
        $blog_id = $wpdb->blogid;
        if ($blog_id > 1) {
            $file = ALM_PATH . 'core/repeater/' . $blog_id . '/default.php';
            // File
        } else {
            $file = ALM_PATH . 'core/repeater/default.php';
        }
    }
    return $file;
}
Ejemplo n.º 30
0
/**
 * Loads the theme styles & scripts.
 *
 * @since 1.0.0
 * @link  http://codex.wordpress.org/Function_Reference/wp_enqueue_script
 * @link  http://codex.wordpress.org/Function_Reference/wp_enqueue_style
 */
function gomedia_enqueue()
{
    // Load bootstrap styles.
    wp_enqueue_style('gomedia-bootstrap-css', trailingslashit(get_template_directory_uri()) . 'assets/css/bootstrap.min.css', null, null);
    // Load bootstrap theme styles.
    wp_enqueue_style('gomedia-bootstrap-theme', trailingslashit(get_template_directory_uri()) . 'assets/css/bootstrap-theme.min.css', null, null);
    // if WP_DEBUG and/or SCRIPT_DEBUG turned on, load the unminified styles & script.
    if (WP_DEBUG || SCRIPT_DEBUG) {
        // Load main stylesheet
        wp_enqueue_style('gomedia-style', get_stylesheet_uri());
        // Load custom js plugins.
        wp_enqueue_script('gomedia-plugins', trailingslashit(get_template_directory_uri()) . 'assets/js/plugins.js', array('jquery'), null, true);
        // Load custom js methods.
        wp_enqueue_script('gomedia-main', trailingslashit(get_template_directory_uri()) . 'assets/js/main.js', array('jquery'), null, true);
    } else {
        // Load main stylesheet
        wp_enqueue_style('gomedia-style', trailingslashit(get_template_directory_uri()) . 'style.min.css');
        // If child theme is active, load the stylesheet.
        if (is_child_theme()) {
            wp_enqueue_style('gomedia-child-style', get_stylesheet_uri());
        }
        // Load custom js plugins.
        wp_enqueue_script('gomedia-scripts', trailingslashit(get_template_directory_uri()) . 'assets/js/gomedia.min.js', array('jquery'), null, true);
    }
    // Load bootstrap scripts.
    wp_enqueue_script('gomedia-bootstrap', trailingslashit(get_template_directory_uri()) . 'assets/js/bootstrap.min.js', array('jquery'), null, true);
    // Load comment-reply script.
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}