本文整理汇总了PHP中get_theme_support函数的典型用法代码示例。如果您正苦于以下问题:PHP get_theme_support函数的具体用法?PHP get_theme_support怎么用?PHP get_theme_support使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_theme_support函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pls_register_sidebars
/**
* Register the default framework sidebars. Theme developers may optionally
* choose to support these sidebars within their themes or add more custom
* sidebars to the mix.
*
* @since 0.0.1
* @uses register_sidebar() Registers a sidebar with WordPress.
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function pls_register_sidebars()
{
/** Get theme-supported sidebars. */
$sidebar_support = get_theme_support('pls-sidebars');
/** If there is no array of sidebars IDs, return. */
if (!is_array($sidebar_support[0])) {
return;
}
/** Set up the default sidebar arguments. */
if (get_theme_support('pls-main-sidebar')) {
$sidebars[] = array('id' => 'primary', 'name' => 'Default Sidebar', 'description' => 'The main (primary) widget area, most often used as a sidebar on pages that do not have a custom sidebar.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-home-sidebar')) {
$sidebars[] = array('id' => 'home', 'name' => 'Home Page', 'description' => 'The home page widget area, most often used as a sidebar on pages that do not have a custom sidebar.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-listings-search-sidebar')) {
$sidebars[] = array('id' => 'listings-search', 'name' => 'Listings Search Sidebar', 'description' => 'The main (primary) widget area, most often used as a sidebar.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-single-property-sidebar')) {
$sidebars[] = array('id' => 'single-property', 'name' => 'Single Property Sidebar', 'description' => 'Widget area displayed on single property details page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
/** Set up other sidebar arguments to be available on request. */
if (get_theme_support('pls-rental-search-sidebar')) {
$sidebars[] = array('id' => 'rental-search', 'name' => 'Rental Search Sidebar', 'description' => 'Widget area displayed on Rental Search page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-sales-search-sidebar')) {
$sidebars[] = array('id' => 'sales-search', 'name' => 'Sales Search Sidebar', 'description' => 'Widget area displayed on Sales Search page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-contact-sidebar')) {
$sidebars[] = array('id' => 'contact', 'name' => 'Contact Page Sidebar', 'description' => 'Widget area displayed on Contact page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-blog-index-sidebar')) {
$sidebars[] = array('id' => 'blog-index', 'name' => 'Blog Index Sidebar', 'description' => 'Widget area displayed on Blog Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-single-post-sidebar')) {
$sidebars[] = array('id' => 'single-post', 'name' => 'Single Blog Post Sidebar', 'description' => 'Widget area displayed on single blog post page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-neighborhoods-sidebar')) {
$sidebars[] = array('id' => 'neighborhoods', 'name' => 'Neighborhoods Page Sidebar', 'description' => 'Widget area displayed on Neighborhoods Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-single-neighborhood-sidebar')) {
$sidebars[] = array('id' => 'single-neighborhood', 'name' => 'Single Neighborhood Sidebar', 'description' => 'Widget area displayed on single neighborhood details page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-testimonials-sidebar')) {
$sidebars[] = array('id' => 'testimonials', 'name' => 'Testimonials Page Sidebar', 'description' => 'Widget area displayed on Testimonials Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-agents-sidebar')) {
$sidebars[] = array('id' => 'agents', 'name' => 'Agents Page Sidebar', 'description' => 'Widget area displayed on Agents Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
if (get_theme_support('pls-services-sidebar')) {
$sidebars[] = array('id' => 'services', 'name' => 'Services Page Sidebar', 'description' => 'Widget area displayed on Services Index page.', 'before_widget' => '<section id="%1$s" class="widget %2$s widget-%2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
}
// pls_dump($sidebar_support);
// loop through and create sidebars
foreach ($sidebars as $sidebar) {
if (in_array($sidebar['id'], $sidebar_support[0])) {
register_sidebar($sidebar);
}
}
}
开发者ID:lytranuit,项目名称:wordpress,代码行数:69,代码来源:sidebars.php
示例2: franz_header_image
/**
* Creates the tag for header image
*/
function franz_header_image()
{
$header = get_custom_header();
if ($header->url) {
/* Scale hidpi header image */
$custom_header = get_theme_support('custom-header');
$header_args = array_pop($custom_header);
if ($header->width >= 2 * $header_args['width']) {
$header->width = floor($header->width / 2);
$header->height = floor($header->height / 2);
}
?>
<img class="img-responsive" src="<?php
echo esc_url($header->url);
?>
" height="<?php
echo esc_attr($header->height);
?>
" width="<?php
echo esc_attr($header->width);
?>
" alt="" />
<?php
} else {
bloginfo('name');
}
}
开发者ID:aragonc,项目名称:chamiluda,代码行数:31,代码来源:header.php
示例3: mh_newsdesk_lite_logo
function mh_newsdesk_lite_logo()
{
$header_img = get_header_image();
$header_title = get_bloginfo('name');
$header_desc = get_bloginfo('description');
echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr($header_title) . '" rel="home">' . "\n";
echo '<div class="logo-wrap" role="banner">' . "\n";
if ($header_img) {
echo '<img src="' . esc_url($header_img) . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . esc_attr($header_title) . '" />' . "\n";
}
if (0 && display_header_text()) {
$text_color = get_header_textcolor();
if ($text_color != get_theme_support('custom-header', 'default-text-color')) {
echo '<style type="text/css" id="mh-header-css">';
echo '.logo-title, .logo-tagline { color: #' . esc_attr($text_color) . '; }';
echo '</style>' . "\n";
}
echo '<div class="logo">' . "\n";
if ($header_title) {
echo '<h1 class="logo-title">' . esc_attr($header_title) . '</h1>' . "\n";
}
if ($header_desc) {
echo '<h2 class="logo-tagline">' . esc_attr($header_desc) . '</h2>' . "\n";
}
echo '</div>' . "\n";
}
echo '</div>' . "\n";
echo '</a>' . "\n";
}
开发者ID:rafaelnco,项目名称:tiamaria,代码行数:29,代码来源:mh-custom-functions.php
示例4: genesis_footer_widget_areas
/**
* Echo the markup necessary to facilitate the footer widget areas.
*
* Check for a numerical parameter given when adding theme support - if none is found, then the function returns early.
*
* The child theme must style the widget areas.
*
* Applies the `genesis_footer_widget_areas` filter.
*
* @since 1.6.0
*
* @uses genesis_structural_wrap() Optionally adds wrap with footer-widgets context.
*
* @return null Return early if number of widget areas could not be determined, or nothing is added to the first widget area.
*/
function genesis_footer_widget_areas()
{
$footer_widgets = get_theme_support('genesis-footer-widgets');
if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
return;
}
$footer_widgets = (int) $footer_widgets[0];
//* Check to see if first widget area has widgets. If not, do nothing. No need to check all footer widget areas.
if (!is_active_sidebar('footer-1')) {
return;
}
$inside = '';
$output = '';
$counter = 1;
while ($counter <= $footer_widgets) {
//* Darn you, WordPress! Gotta output buffer.
ob_start();
dynamic_sidebar('footer-' . $counter);
$widgets = ob_get_clean();
if ($widgets) {
$inside .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
}
$counter++;
}
if ($inside) {
$output .= genesis_markup(array('html5' => '<div %s>' . genesis_sidebar_title('Footer'), 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets', 'echo' => false));
$output .= genesis_structural_wrap('footer-widgets', 'open', 0);
$output .= $inside;
$output .= genesis_structural_wrap('footer-widgets', 'close', 0);
$output .= '</div>';
}
echo apply_filters('genesis_footer_widget_areas', $output, $footer_widgets);
}
开发者ID:robalford,项目名称:alfordhomesinc,代码行数:48,代码来源:footer.php
示例5: initialize
public function initialize()
{
$this->user = new stdClass();
if (is_user_logged_in()) {
/* Populate settings we need for the menu based on the current user. */
$this->user->blogs = get_blogs_of_user(get_current_user_id());
if (is_multisite()) {
$this->user->active_blog = get_active_blog_for_user(get_current_user_id());
$this->user->domain = empty($this->user->active_blog) ? user_admin_url() : trailingslashit(get_home_url($this->user->active_blog->blog_id));
$this->user->account_domain = $this->user->domain;
} else {
$this->user->active_blog = $this->user->blogs[get_current_blog_id()];
$this->user->domain = trailingslashit(home_url());
$this->user->account_domain = $this->user->domain;
}
}
add_action('wp_head', 'wp_admin_bar_header');
add_action('admin_head', 'wp_admin_bar_header');
if (current_theme_supports('admin-bar')) {
$admin_bar_args = get_theme_support('admin-bar');
// add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
$header_callback = $admin_bar_args[0]['callback'];
}
if (empty($header_callback)) {
$header_callback = '_admin_bar_bump_cb';
}
add_action('wp_head', $header_callback);
wp_enqueue_script('admin-bar');
wp_enqueue_style('admin-bar');
do_action('admin_bar_init');
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:31,代码来源:class-wp-admin-bar.php
示例6: cfpf_init
function cfpf_init()
{
$this->post_formats = get_theme_support('post-formats');
if (!empty($this->post_formats[0]) && is_array($this->post_formats[0])) {
if (in_array('gallery', $this->post_formats[0])) {
//out('gallery');
add_action('save_post', array($this, 'postformat_gallery_save_post'));
}
if (in_array('link', $this->post_formats[0])) {
//out('link');
add_action('save_post', array($this, 'postformat_link_save_post'));
}
if (in_array('status', $this->post_formats[0])) {
//out('status');
add_action('save_post', array($this, 'postformat_status_save_post'), 10, 2);
}
if (in_array('quote', $this->post_formats[0])) {
//out('quote');
add_action('save_post', array($this, 'postformat_quote_save_post'), 10, 2);
}
if (in_array('video', $this->post_formats[0])) {
//out('video');
add_action('save_post', array($this, 'postformat_video_save_post'));
}
if (in_array('audio', $this->post_formats[0])) {
//out('gallery');
add_action('save_post', array($this, 'postformat_audio_save_post'));
}
}
}
开发者ID:ArnaudGuillou,项目名称:SiteESBVolley,代码行数:30,代码来源:settings-object.php
示例7: reactor_register_sidebars
function reactor_register_sidebars()
{
$sidebars = get_theme_support('reactor-sidebars');
if (!is_array($sidebars[0])) {
return;
}
if (in_array('primary', $sidebars[0])) {
register_sidebar(array('name' => __('Primary Sidebar', 'reactor'), 'id' => 'sidebar', 'description' => 'The primary sidebar for 2 column layouts', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
if (in_array('secondary', $sidebars[0])) {
register_sidebar(array('name' => __('Secondary Sidebar', 'reactor'), 'id' => 'sidebar-2', 'description' => 'The secondary sidebar for 3 column layouts', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
if (in_array('front-primary', $sidebars[0])) {
register_sidebar(array('name' => __('Front Page Primary', 'reactor'), 'id' => 'sidebar-frontpage', 'description' => 'Primary sidebar for the front page template', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
if (in_array('front-secondary', $sidebars[0])) {
register_sidebar(array('name' => __('Front Page Secondary', 'reactor'), 'id' => 'sidebar-frontpage-2', 'description' => 'Secondary sidebar for the front page template', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
if (in_array('footer', $sidebars[0])) {
$footer = '<div id="%1$s" class="widget top-bar-widget ';
$footer .= 'large-' . reactor_get_widget_columns('sidebar-footer');
$footer .= ' columns %2$s">';
register_sidebar(array('name' => __('Footer', 'reactor'), 'id' => 'sidebar-footer', 'description' => 'Footer widget area', 'class' => '', 'before_widget' => $footer, 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
}
开发者ID:patlegris,项目名称:angularpresstheme,代码行数:25,代码来源:sidebars.php
示例8: mh_logo
function mh_logo()
{
$header_img = get_header_image();
$header_title = get_bloginfo('name');
$header_desc = get_bloginfo('description');
echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr($header_title) . '" rel="home">' . "\n";
echo '<div class="logo-wrap" role="banner">' . "\n";
if ($header_img) {
echo '<img src="' . esc_url($header_img) . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . esc_attr($header_title) . '" />' . "\n";
}
if (display_header_text()) {
$header_img ? $logo_pos = 'logo-overlay' : ($logo_pos = 'logo-text');
$text_color = get_header_textcolor();
if ($text_color != get_theme_support('custom-header', 'default-text-color')) {
echo '<style type="text/css" id="mh-header-css">';
echo '.logo-name, .logo-desc { color: #' . esc_attr($text_color) . '; }';
echo '.logo-name { border-bottom: 3px solid #' . esc_attr($text_color) . '; }';
echo '</style>' . "\n";
}
echo '<div class="logo ' . $logo_pos . '">' . "\n";
if ($header_title) {
echo '<h1 class="logo-name">' . esc_attr($header_title) . '</h1>' . "\n";
}
if ($header_desc) {
echo '<h2 class="logo-desc">' . esc_attr($header_desc) . '</h2>' . "\n";
}
echo '</div>' . "\n";
}
echo '</div>' . "\n";
echo '</a>' . "\n";
}
开发者ID:davidHuanghw,项目名称:david_blog,代码行数:31,代码来源:mh-custom-functions.php
示例9: tamatebako_fonts_label
/**
* Fonts Customizer Label
*/
function tamatebako_fonts_label()
{
$defaults = array('fonts' => 'Fonts');
$theme_support = get_theme_support('tamatebako-custom-fonts');
$args = isset($theme_support[2]) ? $theme_support[2] : array();
return wp_parse_args($args, $defaults);
}
开发者ID:WPDevHQ,项目名称:nevertheless,代码行数:10,代码来源:custom-fonts.php
示例10: upbootwp_header_style
/**
* Styles the header image and text displayed on the blog
*
* @see upbootwp_custom_header_setup().
*/
function upbootwp_header_style()
{
$header_image = get_header_image();
$text_color = get_header_textcolor();
// If no custom options for text are set, let's bail.
if (empty($header_image) && $text_color == get_theme_support('custom-header', 'default-text-color')) {
return;
}
// If we get this far, we have custom styles.
?>
<style type="text/css" id="upbootwp-header-css">
<?php
if (!empty($header_image)) {
?>
.site-header {
background: url(<?php
header_image();
?>
) no-repeat scroll top;
background-size: 1600px auto;
height:<?php
echo header_image()->height;
?>
px;
}
<?php
}
// Has the text been hidden?
if (!display_header_text()) {
?>
.site-title,
.site-description {
position: absolute;
clip: rect(1px 1px 1px 1px); /* IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
<?php
if (empty($header_image)) {
?>
.site-header .home-link {
min-height: 0;
}
<?php
}
// If the user has set a custom color for the text, use that.
} elseif ($text_color != get_theme_support('custom-header', 'default-text-color')) {
?>
.site-title,
.site-description {
color: #<?php
echo esc_attr($text_color);
?>
;
}
<?php
}
?>
</style>
<?php
}
开发者ID:peternem,项目名称:new-cc,代码行数:65,代码来源:Copy+of+custom-header.php
示例11: circleflip_header_style
/**
* Styles the header image and text displayed on the blog
*
* @author Automattic
* @since 1.2.0 - 05.04.2012
*
* @return void
*/
function circleflip_header_style()
{
// If no custom options for text are set, let's bail
// get_header_textcolor() options: get_theme_support( 'custom-header', 'default-text-color' ) is default, hide text (returns 'blank') or any hex value
if (get_theme_support('custom-header', 'default-text-color') != get_header_textcolor()) {
?>
<style type="text/css">
<?php
if ('blank' == get_header_textcolor()) {
?>
#branding hgroup {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
<?php
} else {
?>
#site-description {
color: #<?php
echo get_header_textcolor();
?>
!important;
}
<?php
}
?>
</style>
<?php
}
}
开发者ID:purgesoftwares,项目名称:purges,代码行数:39,代码来源:custom-header.php
示例12: get_theme_support
/**
* Grab the setting element selectors defined in the customize-inline-editing theme support,
* or provide fallback defaults for themes bundled with Core.
*
* @return array
*/
function get_theme_support()
{
$support = get_theme_support('customize-inline-editing');
if (!empty($support)) {
$setting_element_selectors = array_shift($support);
} else {
$setting_element_selectors = array();
if ('twentyten' === get_template()) {
$setting_element_selectors['blogname'] = '#branding a[rel=home]';
$setting_element_selectors['blogdescription'] = '#site-description';
} elseif ('twentyeleven' === get_template()) {
$setting_element_selectors['blogname'] = '#site-title a';
$setting_element_selectors['blogdescription'] = '#site-description';
} elseif ('twentytwelve' === get_template()) {
$setting_element_selectors['blogname'] = '.site-title a';
$setting_element_selectors['blogdescription'] = '.site-description';
} elseif ('twentythirteen' === get_template()) {
$setting_element_selectors['blogname'] = '.site-title';
$setting_element_selectors['blogdescription'] = '.site-description';
} elseif ('twentyfourteen' === get_template()) {
$setting_element_selectors['blogname'] = '.site-title a';
} elseif ('twentyfifteen' === get_template()) {
$setting_element_selectors['blogname'] = '.site-title a';
$setting_element_selectors['blogdescription'] = '.site-description';
} elseif ('twentysixteen' === get_template()) {
$setting_element_selectors['blogname'] = '.site-title a';
$setting_element_selectors['blogdescription'] = '.site-description';
}
}
return $setting_element_selectors;
}
开发者ID:xwp,项目名称:wp-customize-inline-editing,代码行数:37,代码来源:customize-inline-editing.php
示例13: calibrefx_do_footer_widgets
/**
* Display the footer widget if the footer widget are active.
*/
function calibrefx_do_footer_widgets()
{
global $wp_registered_sidebars;
$footer_widgets = get_theme_support('calibrefx-footer-widgets');
$all_widgets = wp_get_sidebars_widgets();
//Check if footer widget theme support is activated or is there any widget inside
if (!$footer_widgets or !isset($all_widgets['footer-widget'])) {
return;
}
$count_footer_widgets = count($all_widgets['footer-widget']);
if (0 == $count_footer_widgets) {
return;
}
if (current_theme_supports('calibrefx-responsive-style')) {
$span = 'col-lg-' . strval(floor(12 / $count_footer_widgets)) . ' col-md-' . strval(floor(12 / $count_footer_widgets)) . ' col-sm-12 col-xs-12';
} else {
$span = 'col-xs-' . strval(floor(12 / $count_footer_widgets));
}
$sidebar = $wp_registered_sidebars['footer-widget'];
$footer_widget_column = apply_filters('calibrefx_footer_widget_column_span', $span);
$sidebar['before_widget'] = '<div id="%1$s" class="widget ' . $footer_widget_column . ' %2$s">';
$sidebar['after_widget'] = '</div>';
unregister_sidebar('footer-widget');
register_sidebar($sidebar);
if (is_active_sidebar('footer-widget')) {
echo '<div id="footer-widget">';
calibrefx_put_wrapper('footer-widget', 'open');
$footer_widget_wrapper_class = apply_filters('footer_widget_wrapper_class', calibrefx_row_class());
echo '<div class="footer-widget-wrapper"><div class="' . $footer_widget_wrapper_class . '">';
dynamic_sidebar('footer-widget');
echo '</div></div><!--end .footer-widget-wrapper -->';
calibrefx_put_wrapper('footer-widget', 'close');
echo '</div><!--end #footer-widget-->';
}
}
开发者ID:alispx,项目名称:calibrefx,代码行数:38,代码来源:footer-hook.php
示例14: hipword_header_style
function hipword_header_style()
{
$header_image = get_header_image();
$text_color = get_header_textcolor();
// If no custom options for text are set, let's bail.
if (empty($header_image) && $text_color == get_theme_support('custom-header', 'default-text-color')) {
return;
}
// If we get this far, we have custom styles.
?>
<style type="text/css" id="hipword-header-css">
<?php
if (!empty($header_image)) {
?>
.header-top {
background: url(<?php
header_image();
?>
);
background-position: 50% 0;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}?>
<?php
}
?>
</style>
<?php
}
开发者ID:alexdbrown,项目名称:wordpress_practice,代码行数:32,代码来源:custom-header.php
示例15: genesis_footer_widget_areas
/**
* Echos the markup necessary to facilitate the footer widget areas.
*
* Checks for a numerical parameter given when adding theme support - if none is
* found, then the function returns early.
*
* The child theme must style the widget areas.
*
* @since 1.6.0
*
* @return null Returns early if number of widget areas could not be determined,
* or nothing is added to the first widget area
*/
function genesis_footer_widget_areas()
{
$footer_widgets = get_theme_support('genesis-footer-widgets');
if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
return;
}
$footer_widgets = (int) $footer_widgets[0];
/**
* Check to see if first widget area has widgets. If not,
* do nothing. No need to check all footer widget areas.
*/
if (!is_active_sidebar('footer-1')) {
return;
}
$output = '';
$counter = 1;
while ($counter <= $footer_widgets) {
/** Darn you, WordPress! Gotta output buffer. */
ob_start();
dynamic_sidebar('footer-' . $counter);
$widgets = ob_get_clean();
$output .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
$counter++;
}
echo apply_filters('genesis_footer_widget_areas', sprintf('<div id="footer-widgets" class="footer-widgets">%2$s%1$s%3$s</div>', $output, genesis_structural_wrap('footer-widgets', 'open', 0), genesis_structural_wrap('footer-widgets', 'close', 0)));
}
开发者ID:hscale,项目名称:webento,代码行数:39,代码来源:footer.php
示例16: reactor_register_menus
function reactor_register_menus()
{
/**
* Register navigation menus for a theme.
*
* @since 1.0.0
* @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
*/
$menus = get_theme_support('reactor-menus');
if (!is_array($menus[0])) {
return;
}
if (in_array('top-bar-l', $menus[0])) {
register_nav_menu('top-bar-l', __('Top Bar Left', 'reactor'));
}
if (in_array('top-bar-r', $menus[0])) {
register_nav_menu('top-bar-r', __('Top Bar Right', 'reactor'));
}
if (in_array('main-menu', $menus[0])) {
register_nav_menu('main-menu', __('Main Menu', 'reactor'));
}
if (in_array('footer-links', $menus[0])) {
register_nav_menu('footer-links', __('Footer Links', 'reactor'));
}
}
开发者ID:terngkub,项目名称:reactor,代码行数:25,代码来源:menus.php
示例17: flagship_footer_widgets
/**
* Displays all registered footer widget areas using a template.
*
* @since 1.0.0
* @uses locate_template() Load the footer widget template.
* @return null Return early if there's no theme support.
*/
function flagship_footer_widgets()
{
// Get the current theme's support for footer widgets.
$footer_widgets = get_theme_support('flagship-footer-widgets');
if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
return;
}
// Return early if the first widget area has no widgets.
if (!is_active_sidebar('footer-1')) {
return;
}
$footer_widgets = (int) $footer_widgets[0];
$counter = 1;
?>
<div <?php
hybrid_attr('footer-widgets');
?>
>
<div class="wrap">
<?php
while ($counter <= $footer_widgets) {
?>
<?php
include locate_template('sidebar/footer-widgets.php');
?>
<?php
$counter++;
?>
<?php
}
?>
</div>
</div>
<?php
}
开发者ID:stedy67,项目名称:Compass,代码行数:42,代码来源:general.php
示例18: init
/**
* Conditionally Hook into WordPress.
*
* Themes must declare that they support this module by adding
* add_theme_support( 'featured-content' ); during after_setup_theme.
*
* If no theme support is found there is no need to hook into
* WordPress. We'll just return early instead.
*
* @uses Featured_Content::$max_posts
*/
public static function init()
{
$theme_support = get_theme_support('featured-content');
// Return early if theme does not support featured content.
if (!$theme_support) {
return;
}
// An array of named arguments must be passed as
// the second parameter of add_theme_support().
if (!isset($theme_support[0])) {
return;
}
// Return early if "featured_content_filter" has not been defined.
if (!isset($theme_support[0]['featured_content_filter'])) {
return;
}
$filter = $theme_support[0]['featured_content_filter'];
// Themes can override the number of max posts.
if (isset($theme_support[0]['max_posts'])) {
self::$max_posts = absint($theme_support[0]['max_posts']);
}
add_filter($filter, array(__CLASS__, 'get_featured_posts'));
add_action('admin_init', array(__CLASS__, 'register_setting'));
add_action('save_post', array(__CLASS__, 'delete_transient'));
add_action('delete_post_tag', array(__CLASS__, 'delete_post_tag'));
add_action('pre_get_posts', array(__CLASS__, 'pre_get_posts'));
// Hide "featured" tag from the front-end.
if (self::get_setting('hide-tag')) {
add_filter('get_terms', array(__CLASS__, 'hide_featured_term'), 10, 2);
add_filter('get_the_terms', array(__CLASS__, 'hide_the_featured_term'), 10, 3);
}
}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:43,代码来源:featured-content.php
示例19: custom_background
function custom_background()
{
$bg_image_url = get_background_image();
$bg_color = get_background_color();
// If the user has not defined a background
// color or a background image, we stop.
if (!$bg_image_url && !$bg_color) {
return;
}
// If there is only a background color defined,
// we apply it to <body>, then we stop.
if (!$bg_image_url && $bg_color) {
echo '<style>
body {
background-color: #' . $bg_color . ';
}
</style>';
return;
}
echo '<style>
body {
background-color: #' . $bg_color . ';
background-image: url(' . $bg_image_url . ');
background-repeat: ' . get_theme_mod('background_repeat', get_theme_support('custom-background', 'default-repeat')) . ';
background-position: ' . get_theme_mod('background_position_x', get_theme_support('custom-background', 'default-position-x')) . ';
background-attachment: ' . get_theme_mod('background_attachment', get_theme_support('custom-background', 'default-attachment')) . '
}
</style>';
}
开发者ID:benjamincrozat,项目名称:wp-theme-boilerplate,代码行数:29,代码来源:helpers.php
示例20: __construct
function __construct(&$owner)
{
parent::__construct($owner, get_class($this), __('General Settings', XF_TEXTDOMAIN));
$measures = $this->owner->get_measures();
$this->options[] = new xtreme_option_bool($this, false, 'responsive', __('Responsive Design:', XF_TEXTDOMAIN), false);
$this->options[] = new xtreme_option_bool($this, false, 'html5', __('Output HTML5:', XF_TEXTDOMAIN), false);
$this->options[] = new xtreme_option_numeric($this, false, 'bodyfontsize', __('Body Fontsize:', XF_TEXTDOMAIN), 75, '%', $measures, false, array('%' => array(62.5, 68.75, 75.0, 81.25, 87.5, 100.0)));
$this->options[] = new xtreme_option_select_pair($this, false, 'layout', __('Layout:', XF_TEXTDOMAIN), 1, array(__('fixed', XF_TEXTDOMAIN), __('flexible', XF_TEXTDOMAIN)));
$this->options[] = new xtreme_option_numeric($this, false, 'minwidth', __('Minimum Layout Width:', XF_TEXTDOMAIN), 740, 'px', $measures, array('px' => array(100, 2000)), false, false);
$this->options[] = new xtreme_option_numeric($this, false, 'maxwidth', __('Maximum Layout Width:', XF_TEXTDOMAIN), 80, 'em', $measures, array('em' => array(20, 200), '%' => array(20, 100)), false, false);
$this->options[] = new xtreme_option_numeric($this, false, 'width', __('Layout Width:', XF_TEXTDOMAIN), 960, 'px', $measures, array('px' => array(100, 2000)), false, false);
$this->options[] = new xtreme_option_select_pair($this, false, 'layoutalign', __('Alignment:', XF_TEXTDOMAIN), 1, array(__('left', XF_TEXTDOMAIN), __('center', XF_TEXTDOMAIN), __('right', XF_TEXTDOMAIN)));
$this->options[] = new xtreme_option_select_pair($this, false, 'appearance', __('Design:', XF_TEXTDOMAIN), 0, array(__('blog layout', XF_TEXTDOMAIN), __('full page layout', XF_TEXTDOMAIN)));
if (current_theme_supports('xtreme-color-styles')) {
$support = get_theme_support('xtreme-color-styles');
$colors = $support[0];
$color_keys = array_keys($colors);
$this->options[] = new xtreme_option_select_pair($this, false, 'color_styles', __('Color Style:', XF_TEXTDOMAIN), $color_keys[0], $colors);
} else {
$this->options[] = new xtreme_option_hidden($this, false, 'color_styles', '', '');
}
/*
$this->options[] = new xtreme_option_select_pair($this, false, 'post_socials', __('Social Bookmark Support on Posts:', XF_TEXTDOMAIN), 'none', array('disabled' => __('disabled', XF_TEXTDOMAIN), 'none' => __('enabled, but not predefined', XF_TEXTDOMAIN), 'option' => __('enabled, predefined globally', XF_TEXTDOMAIN), 'postmeta' => __('enabled, predefined post specific', XF_TEXTDOMAIN)));
$this->options[] = new xtreme_option_select_pair($this, false, 'post_socials_layout', __('Social Bookmark Layout Placement
|
请发表评论