本文整理汇总了PHP中require_if_theme_supports函数的典型用法代码示例。如果您正苦于以下问题:PHP require_if_theme_supports函数的具体用法?PHP require_if_theme_supports怎么用?PHP require_if_theme_supports使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了require_if_theme_supports函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_options
static function get_options()
{
// Cache options
$cache = new PLS_Cache('Theme PLS Options');
$cache_args = array();
if ($options = $cache->get($cache_args)) {
self::$styles = array_merge(self::$styles, $options);
return;
}
require PLS_Route::locate_blueprint_option('init.php');
require_if_theme_supports("pls-user-options", PLS_Route::locate_blueprint_option('user.php'));
require_if_theme_supports("pls-search-options", PLS_Route::locate_blueprint_option('search.php'));
require_if_theme_supports("pls-color-options", PLS_Route::locate_blueprint_option('colors.php'));
require_if_theme_supports("pls-slideshow-options", PLS_Route::locate_blueprint_option('slideshow.php'));
require_if_theme_supports("pls-typography-options", PLS_Route::locate_blueprint_option('typography.php'));
require_if_theme_supports("pls-header-options", PLS_Route::locate_blueprint_option('header.php'));
require_if_theme_supports("pls-navigation-options", PLS_Route::locate_blueprint_option('navigation.php'));
require_if_theme_supports("pls-listing-options", PLS_Route::locate_blueprint_option('listings.php'));
require_if_theme_supports("pls-post-options", PLS_Route::locate_blueprint_option('post.php'));
require_if_theme_supports("pls-widget-options", PLS_Route::locate_blueprint_option('widget.php'));
require_if_theme_supports("pls-footer-options", PLS_Route::locate_blueprint_option('footer.php'));
require_if_theme_supports("pls-css-options", PLS_Route::locate_blueprint_option('css.php'));
// Cache options
$cache->save(self::$styles);
}
示例2: hybrid_admin_load_post_meta_boxes
/**
* Loads the core post meta box files on the 'load-post.php' action hook. Each meta box file is only loaded if
* the theme declares support for the feature.
*
* @since 1.2.0
* @return void
*/
function hybrid_admin_load_post_meta_boxes()
{
/* Load the SEO post meta box. */
require_if_theme_supports('hybrid-core-seo', trailingslashit(HYBRID_ADMIN) . 'meta-box-post-seo.php');
/* Load the post template meta box. */
require_if_theme_supports('hybrid-core-template-hierarchy', trailingslashit(HYBRID_ADMIN) . 'meta-box-post-template.php');
}
示例3: hybrid_admin_load_post_meta_boxes
/**
* Loads the core post meta box files on the 'load-post.php' action hook. Each meta box file is only loaded if
* the theme declares support for the feature.
*
* @since 1.2.0
* @access public
* @return void
*/
function hybrid_admin_load_post_meta_boxes()
{
// Load the post template meta box.
require_if_theme_supports('hybrid-core-template-hierarchy', HYBRID_ADMIN . 'meta-box-post-template.php');
// Load the layout meta box.
require_if_theme_supports('theme-layouts', HYBRID_ADMIN . 'meta-box-post-layout.php');
// Load the post style meta box.
require_once HYBRID_ADMIN . 'meta-box-post-style.php';
}
示例4: functions
function functions()
{
// required functions
require_once locate_template('/framework/functions/get-options.php');
require_once locate_template('/framework/functions/helpers.php');
require_once locate_template('/framework/functions/layouts.php');
require_once locate_template('/framework/functions/post-meta.php');
require_once locate_template('/framework/functions/srcset-images.php');
require_once locate_template('/framework/functions/theme-supports.php');
// if theme supports functions
require_if_theme_supports('inti-pagination', locate_template('/framework/functions/pagination.php'));
}
示例5: functions
function functions()
{
// required functions
require_once locate_template('/library/inc/functions/columns.php');
require_once locate_template('/library/inc/functions/helpers.php');
// optional functions
require_once locate_template('/library/inc/functions/top-bar.php');
require_once locate_template('/library/inc/functions/slider.php');
// if theme supports functions
require_if_theme_supports('reactor-breadcrumbs', locate_template('/library/inc/functions/breadcrumbs.php'));
require_if_theme_supports('reactor-custom-login', locate_template('/library/inc/functions/custom-login.php'));
require_if_theme_supports('reactor-page-links', locate_template('/library/inc/functions/page-links.php'));
require_if_theme_supports('reactor-post-meta', locate_template('/library/inc/functions/post-meta.php'));
require_if_theme_supports('reactor-tumblog-icons', locate_template('/library/inc/functions/tumblog-icons.php'));
require_if_theme_supports('reactor-taxonomy-subnav', locate_template('/library/inc/functions/taxonomy-subnav.php'));
}
示例6: the_bootstrap_setup
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @author WordPress.org
* @since 1.0.0 - 05.02.2012
*
* @return void
*/
function the_bootstrap_setup()
{
$themename = 'Pirate Party Australia';
global $content_width;
if (!isset($content_width)) {
$content_width = 770;
}
load_theme_textdomain('the-bootstrap', get_template_directory() . '/lang');
add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');
add_theme_support('post-formats', array('aside', 'chat', 'link', 'gallery', 'status', 'quote', 'image', 'video'));
add_theme_support('tha_hooks', array('all'));
if (version_compare(get_bloginfo('version'), '3.4', '<')) {
// Custom Theme Options
require_once get_template_directory() . '/inc/theme-options.php';
} else {
// Implement the Theme Customizer script
require_once get_template_directory() . '/inc/theme-customizer.php';
}
/**
* Custom template tags for this theme.
*/
require_once get_template_directory() . '/inc/template-tags.php';
/**
* Implement the Custom Header feature
*/
require_once get_template_directory() . '/inc/custom-header.php';
/**
* Custom Nav Menu handler for the Navbar.
*/
require_once get_template_directory() . '/inc/nav-menu-walker.php';
/**
* Theme Hook Alliance
*/
require_if_theme_supports('tha_hooks', get_template_directory() . '/inc/tha-theme-hooks.php');
/**
* Including three menu (header-menu, primary and footer-menu).
* Primary is wrapping in a navbar containing div (wich support responsive variation)
* Header-menu and Footer-menu are inside pills dropdown menu
*
* @since 1.2.2 - 07.04.2012
* @see http://codex.wordpress.org/Function_Reference/register_nav_menus
*/
register_nav_menus(array('primary_left' => __('Main Menu Left', $themename), 'primary_right' => __('Main Menu Right', $themename), 'footer' => __('Footer menu', $themename)));
}
示例7: hybrid_load_customize_classes
/**
* Loads framework-specific customize classes. These are classes that extend the core `WP_Customize_*`
* classes to provide theme authors access to functionality that core doesn't handle out of the box.
*
* @since 3.0.0
* @access public
* @return void
*/
function hybrid_load_customize_classes($wp_customize)
{
// Load customize setting classes.
require_once HYBRID_CUSTOMIZE . 'setting-array-map.php';
require_once HYBRID_CUSTOMIZE . 'setting-image-data.php';
// Load customize control classes.
require_once HYBRID_CUSTOMIZE . 'control-checkbox-multiple.php';
require_once HYBRID_CUSTOMIZE . 'control-dropdown-terms.php';
require_once HYBRID_CUSTOMIZE . 'control-palette.php';
require_once HYBRID_CUSTOMIZE . 'control-radio-image.php';
require_once HYBRID_CUSTOMIZE . 'control-select-group.php';
require_once HYBRID_CUSTOMIZE . 'control-select-multiple.php';
require_if_theme_supports('theme-layouts', HYBRID_CUSTOMIZE . 'control-layout.php');
// Register JS control types.
$wp_customize->register_control_type('Hybrid_Customize_Control_Checkbox_Multiple');
$wp_customize->register_control_type('Hybrid_Customize_Control_Palette');
$wp_customize->register_control_type('Hybrid_Customize_Control_Radio_Image');
$wp_customize->register_control_type('Hybrid_Customize_Control_Select_Group');
$wp_customize->register_control_type('Hybrid_Customize_Control_Select_Multiple');
}
示例8: add_action
require_once XF_THEME_DIR . '/lib/xtreme-theme-router.php';
require_once XF_THEME_DIR . '/lib/xtreme-template-loader.php';
require_once XF_THEME_DIR . '/lib/xtreme-template-functions.php';
require_once XF_THEME_DIR . '/lib/xtreme-navigation.php';
require_once XF_THEME_DIR . '/lib/xtreme-post-functions.php';
require_once XF_THEME_DIR . '/lib/xtreme-image-functions.php';
require_once XF_THEME_DIR . '/lib/xtreme-comment-functions.php';
require_once XF_THEME_DIR . '/lib/xtreme-javascripts.php';
require_once XF_THEME_DIR . '/lib/xtreme-widget-manager.php';
require_once XF_THEME_DIR . '/lib/xtreme-3rd-party-fixes.php';
if (is_admin()) {
require_once XF_ADMIN_DIR . '/includes/xtreme-backend-functions.php';
require_once XF_ADMIN_DIR . '/includes/xtreme-template-finder.php';
require_once XF_ADMIN_DIR . '/includes/xtreme-options.php';
require_once XF_ADMIN_DIR . '/includes/xtreme-metaboxes.php';
require_once XF_ADMIN_DIR . '/includes/xtreme-metaboxes-default.php';
require_once XF_ADMIN_DIR . '/includes/xtreme-metaboxes-layout.php';
require_once XF_ADMIN_DIR . '/includes/xtreme-dialogs.php';
require_once XF_ADMIN_DIR . '/includes/xtreme-github-updater.php';
require_once XF_ADMIN_DIR . '/xtreme-admin-functions.php';
require_once XF_ADMIN_DIR . '/xtreme-backend.php';
require_once XF_ADMIN_DIR . '/xtreme-layouts.php';
require_once XF_ADMIN_DIR . '/xtreme-backup.php';
require_once XF_ADMIN_DIR . '/xtreme-widgets-admin.php';
add_action('admin_head', 'xtreme_favicon_for_admin');
add_action('wp_dashboard_setup', 'xtreme_dashboard_rss_widget_setup');
add_filter('avatar_defaults', 'xtreme_add_gravatar');
}
require_if_theme_supports('xtreme-fancybox', XF_THEME_DIR . '/lib/xtreme-fancybox.php');
require_if_theme_supports('xtreme-subtitles', XF_THEME_DIR . '/lib/xtreme-subtitles.php');
示例9: add_filter
add_filter('enlightenment_select_box_args', 'enlightenment_theme_settings_override_value');
add_filter('enlightenment_textarea_args', 'enlightenment_theme_settings_override_value');
add_filter('enlightenment_upload_media_args', 'enlightenment_theme_settings_override_value');
function enlightenment_theme_settings_override_value($args)
{
global $pagenow;
if ('themes.php' == $pagenow && isset($_GET['page']) && current_theme_supports('enlightenment-theme-settings', 'menu_slug') == $_GET['page']) {
if (false === strpos($args['name'], '[')) {
if (doing_filter('enlightenment_checkbox_args') && empty($args['checked'])) {
$checkbox = enlightenment_theme_option($args['name']);
$args['checked'] = !empty($checkbox);
} elseif (empty($args['value'])) {
$args['value'] = enlightenment_theme_option($args['name']);
}
}
}
return $args;
}
require_once enlightenment_admin_directory() . '/settings-api.php';
require_if_theme_supports('enlightenment-web-fonts', enlightenment_admin_directory() . '/web-fonts.php');
require_if_theme_supports('enlightenment-logo', enlightenment_admin_directory() . '/logo.php');
require_if_theme_supports('enlightenment-menu-icons', enlightenment_admin_directory() . '/menu-icons.php');
require_if_theme_supports('enlightenment-custom-layouts', enlightenment_admin_directory() . '/custom-layouts.php');
require_if_theme_supports('enlightenment-grid-loop', enlightenment_admin_directory() . '/grid-loop.php');
if (current_theme_supports('enlightenment-template-editor')) {
require_once enlightenment_admin_directory() . '/template-editor.php';
require_if_theme_supports('enlightenment-page-builder', enlightenment_admin_directory() . '/page-builder.php');
require_if_theme_supports('post-formats', enlightenment_admin_directory() . '/post-formats-editor.php');
}
require_if_theme_supports('enlightenment-unlimited-sidebars', enlightenment_admin_directory() . '/unlimited-sidebars.php');
require_once enlightenment_admin_directory() . '/validate.php';
示例10: genesis_load_framework
/**
* Loads all the framework files and features.
*
* The genesis_pre_framework action hook is called before any of the files are
* required().
*
* If a child theme defines GENESIS_LOAD_FRAMEWORK as false before requiring
* this init.php file, then this function will abort before any other framework
* files are loaded.
*
* @since 1.6.0
*/
function genesis_load_framework()
{
/** Run the genesis_pre_framework Hook */
do_action('genesis_pre_framework');
/** Short circuit, if necessary */
if (defined('GENESIS_LOAD_FRAMEWORK') && GENESIS_LOAD_FRAMEWORK === false) {
return;
}
/** Load Framework */
require_once GENESIS_LIB_DIR . '/framework.php';
/** Load Classes */
require_once GENESIS_CLASSES_DIR . '/admin.php';
require_once GENESIS_CLASSES_DIR . '/breadcrumb.php';
require_once GENESIS_CLASSES_DIR . '/sanitization.php';
/** Load Functions */
require_once GENESIS_FUNCTIONS_DIR . '/upgrade.php';
require_once GENESIS_FUNCTIONS_DIR . '/general.php';
require_once GENESIS_FUNCTIONS_DIR . '/options.php';
require_once GENESIS_FUNCTIONS_DIR . '/image.php';
require_once GENESIS_FUNCTIONS_DIR . '/menu.php';
require_once GENESIS_FUNCTIONS_DIR . '/layout.php';
require_once GENESIS_FUNCTIONS_DIR . '/formatting.php';
require_once GENESIS_FUNCTIONS_DIR . '/seo.php';
require_once GENESIS_FUNCTIONS_DIR . '/widgetize.php';
require_once GENESIS_FUNCTIONS_DIR . '/feed.php';
require_once GENESIS_FUNCTIONS_DIR . '/i18n.php';
require_once GENESIS_FUNCTIONS_DIR . '/deprecated.php';
/** Load Shortcodes */
require_once GENESIS_SHORTCODES_DIR . '/post.php';
require_once GENESIS_SHORTCODES_DIR . '/footer.php';
/** Load Structure */
require_once GENESIS_STRUCTURE_DIR . '/header.php';
require_once GENESIS_STRUCTURE_DIR . '/footer.php';
require_once GENESIS_STRUCTURE_DIR . '/menu.php';
require_once GENESIS_STRUCTURE_DIR . '/layout.php';
require_once GENESIS_STRUCTURE_DIR . '/post.php';
require_once GENESIS_STRUCTURE_DIR . '/loops.php';
require_once GENESIS_STRUCTURE_DIR . '/comments.php';
require_once GENESIS_STRUCTURE_DIR . '/sidebar.php';
require_once GENESIS_STRUCTURE_DIR . '/archive.php';
require_once GENESIS_STRUCTURE_DIR . '/search.php';
/** Load Admin */
if (is_admin()) {
require_once GENESIS_ADMIN_DIR . '/editor.php';
require_once GENESIS_ADMIN_DIR . '/menu.php';
require_once GENESIS_ADMIN_DIR . '/theme-settings.php';
require_once GENESIS_ADMIN_DIR . '/seo-settings.php';
require_once GENESIS_ADMIN_DIR . '/import-export.php';
require_once GENESIS_ADMIN_DIR . '/readme-menu.php';
require_once GENESIS_ADMIN_DIR . '/inpost-metaboxes.php';
}
require_once GENESIS_ADMIN_DIR . '/term-meta.php';
require_once GENESIS_ADMIN_DIR . '/user-meta.php';
/** Load Javascript */
require_once GENESIS_JS_DIR . '/load-scripts.php';
/** Load CSS */
require_once GENESIS_CSS_DIR . '/load-styles.php';
/** Load Widgets */
require_once GENESIS_WIDGETS_DIR . '/widgets.php';
/** Load Tools */
require_once GENESIS_TOOLS_DIR . '/custom-field-redirect.php';
require_if_theme_supports('post-templates', GENESIS_TOOLS_DIR . '/post-templates.php');
global $_genesis_formatting_allowedtags;
$_genesis_formatting_allowedtags = genesis_formatting_allowedtags();
}
示例11: cakifo_load_theme_support
/**
* Loads the theme functions if the theme/child theme syupports them.
*
* @since Cakifo 1.3
*/
function cakifo_load_theme_support()
{
/* Load the Cakifo sidebars if supported */
require_if_theme_supports('cakifo-sidebars', locate_template('functions/sidebars.php'));
/* Load Cakifo shortcodes if supported */
require_if_theme_supports('cakifo-shortcodes', locate_template('functions/shortcodes.php'));
/* Load the Colorbox Script extention if supported. */
require_if_theme_supports('cakifo-colorbox', locate_template('functions/colorbox.php'));
/* Load the Twitter Button extention if supported */
require_if_theme_supports('cakifo-twitter-button', locate_template('functions/tweet_button.php'));
}
示例12: includes
/**
* Loads the framework files supported by themes and template-related functions/classes.
*
* @since 4.0.0
*/
function includes()
{
// Load Cherry_Wrapping class.
require_once trailingslashit(CHERRY_CLASSES) . 'class-cherry-wrapping.php';
// Load Cherry_Sidebar class.
require_once trailingslashit(CHERRY_CLASSES) . 'class-cherry-sidebar.php';
// Load the HTML attributes functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'attr.php';
// Load the template functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'template.php';
// Load the comments functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'template-comments.php';
// Load the general template functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'template-general.php';
// Load the media template functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'template-media.php';
// Load the custom template tags.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'template-tags.php';
// Load the post template functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'template-post.php';
// Load the meta template functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'template-meta.php';
// Load the custom functions that act independently of the theme templates.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'extras.php';
// Load the structure functions.
require_once trailingslashit(CHERRY_FUNCTIONS) . 'structure.php';
// Load Cherry_Options_Framework class.
require_once trailingslashit(CHERRY_CLASSES) . 'class-cherry-optionsframework.php';
// Load the post format functionality if post formats are supported.
require_if_theme_supports('post-formats', trailingslashit(CHERRY_FUNCTIONS) . 'post-formats.php');
}
示例13: admin
/**
* Load admin files for the framework.
*
* @since 0.7.0
*/
function admin()
{
/* Check if in the WordPress admin. */
if (is_admin()) {
/* Load the main admin file. */
require_once trailingslashit(HYBRID_ADMIN) . 'admin.php';
/* Load the theme settings feature if supported. */
require_if_theme_supports('hybrid-core-theme-settings', trailingslashit(HYBRID_ADMIN) . 'theme-settings.php');
}
}
示例14: omega_admin_load_post_meta_boxes
/**
* Loads the core post meta box files on the 'load-post.php' action hook. Each meta box file is only loaded if
* the theme declares support for the feature.
*
* @since 0.9.0
* @return void
*/
function omega_admin_load_post_meta_boxes()
{
/* Load the post template meta box. */
require_if_theme_supports('omega-template-hierarchy', trailingslashit(OMEGA_ADMIN) . 'meta-box-post-template.php');
}
示例15: require_if_theme_supports
<?php
/**
* Load required support files.
*
* @package Photo_Perfect
*/
/**
* Load Footer Widget Support.
*/
require_if_theme_supports('footer-widgets', get_template_directory() . '/inc/support/footer-widgets.php');