本文整理汇总了PHP中is_child_theme函数的典型用法代码示例。如果您正苦于以下问题:PHP is_child_theme函数的具体用法?PHP is_child_theme怎么用?PHP is_child_theme使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_child_theme函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: satu_enqueue
/**
* 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');
}
示例2: kadence_scripts
/**
* 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');
}
}
示例3: genesis_theme_support
/**
* 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);
}
}
示例4: italystrap_pointer_print_scripts
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
}
示例5: twig_locations
/**
* 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);
}
示例6: widget
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;
}
示例7: jetpack_load_theme_compat
/**
* 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);
}
}
示例8: get_section_dirs
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);
}
示例9: studiofolio_scripts
/**
* 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');
}
示例10: ubuntucommunity_scripts
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'));
}
}
示例11: roots_scripts
/**
* 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');
}
示例12: setup_constants
/**
* 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');
}
}
示例13: zilla_menu
/**
* 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');
}
示例14: ya_scripts
/**
* 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');
}
}
示例15: extension_sections
/**
* 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'));
}