Exemplo n.º 1
0
<?php

/**
 * Sidebar containing the main widget area
 *
 * @package HiveQueen
 * @subpackage HiveQueen_Theme
 * @since HiveQueen Theme 0.1
 */
$options = hivequeen_get_theme_options();
$current_layout = $options['theme_layout'];
if ('content' != $current_layout) {
    ?>
		<div id="secondary" class="widget-area" role="complementary">
			<?php 
    if (!dynamic_sidebar('sidebar-1')) {
        ?>

				<aside id="archives" class="widget">
					<h3 class="widget-title"><?php 
        _e('Side Bar', 'hivequeen');
        ?>
</h3>
					<ul>
						<?php 
        //TODO: Goyo no archives: hq_get_archives( array( 'type' => 'monthly' ) );
        ?>
					</ul>
				</aside>

				<aside id="meta" class="widget">
Exemplo n.º 2
0
 /**
  * Set up theme defaults and registers support for various HiveQueen features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * To override hivequeen_setup() in a child theme, add your own hivequeen_setup to your child theme's
  * functions.php file.
  *
  * @uses load_theme_textdomain()    For translation/localization support.
  * @uses add_editor_style()         To style the visual editor.
  * @uses add_theme_support()        To add support for post thumbnails, automatic feed links, custom headers
  * 	                                and backgrounds, and post formats.
  * @uses register_nav_menus()       To add support for navigation menus.
  * @uses register_default_headers() To register the default custom header images provided with the theme.
  * @uses set_post_thumbnail_size()  To set a custom post thumbnail size.
  *
  * @since HiveQueen Theme 0.1
  */
 function hivequeen_setup()
 {
     /*
      * Make HiveQueen Theme available for translation.
      * Translations can be added to the /languages/ directory.
      * If you're building a theme based on HiveQueen Theme, use
      * a find and replace to change 'hivequeen' to the name
      * of your theme in all the template files.
      */
     load_theme_textdomain('hivequeen', get_template_directory() . '/languages');
     // This theme styles the visual editor with editor-style.css to match the theme style.
     add_editor_style();
     // Load up our theme options page and related code.
     require get_template_directory() . '/inc/theme-options.php';
     // Grab Twenty Eleven's Ephemera widget.
     require get_template_directory() . '/inc/widgets.php';
     // Add default posts and comments RSS feed links to <head>.
     add_theme_support('automatic-feed-links');
     // This theme uses hq_nav_menu() in one location.
     register_nav_menu('primary', __('Primary Menu', 'hivequeen'));
     // Add support for a variety of post formats
     add_theme_support('post-formats', array('aside', 'link', 'gallery', 'status', 'quote', 'image'));
     $theme_options = hivequeen_get_theme_options();
     if ('dark' == $theme_options['color_scheme']) {
         $default_background_color = '1d1d1d';
     } else {
         $default_background_color = 'e2e2e2';
     }
     // Add support for custom backgrounds.
     add_theme_support('custom-background', array('default-color' => $default_background_color));
     // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images
     add_theme_support('post-thumbnails');
     // Add support for custom headers.
     $custom_header_support = array('default-text-color' => '000', 'width' => apply_filters('hivequeen_header_image_width', 200), 'height' => apply_filters('hivequeen_header_image_height', 200), 'flex-height' => true, 'random-default' => true, 'hq-head-callback' => 'hivequeen_header_style', 'admin-head-callback' => 'hivequeen_admin_header_style', 'admin-preview-callback' => 'hivequeen_admin_header_image');
     add_theme_support('custom-header', $custom_header_support);
     if (!function_exists('get_custom_header')) {
         // This is all for compatibility with versions of HiveQueen prior to 3.4.
         define('HEADER_TEXTCOLOR', $custom_header_support['default-text-color']);
         define('HEADER_IMAGE', '');
         define('HEADER_IMAGE_WIDTH', $custom_header_support['width']);
         define('HEADER_IMAGE_HEIGHT', $custom_header_support['height']);
         add_custom_image_header($custom_header_support['hq-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback']);
         add_custom_background();
     }
     /*
      * We'll be using post thumbnails for custom header images on posts and pages.
      * We want them to be the size of the header image that we just defined.
      * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
      */
     set_post_thumbnail_size($custom_header_support['width'], $custom_header_support['height'], true);
     /*
      * Add Twenty Eleven's custom image sizes.
      * Used for large feature (header) images.
      */
     add_image_size('large-feature', $custom_header_support['width'], $custom_header_support['height'], true);
     // Used for featured posts if a large-feature doesn't exist.
     //add_image_size( 'small-feature', 500, 300 );
     add_image_size('small-feature', 200, 200);
     // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
     register_default_headers(array('queen-bee' => array('url' => '%s/images/headers/queen-bee-162026_960_720.png', 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg', 'description' => __('Queen-Bee', 'hivequeen'))));
     /*
     		),
     		'wheel' => array(
     			'url' => '%s/images/headers/wheel.jpg',
     			'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
     			// translators: header image description
     			'description' => __( 'Wheel', 'hivequeen' )
     		),
     		'shore' => array(
     			'url' => '%s/images/headers/shore.jpg',
     			'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
     			// translators: header image description 
     			'description' => __( 'Shore', 'hivequeen' )
     		),
     		'trolley' => array(
     			'url' => '%s/images/headers/trolley.jpg',
     			'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg',
     			// translators: header image description 
     			'description' => __( 'Trolley', 'hivequeen' )
     		),
     		'pine-cone' => array(
     			'url' => '%s/images/headers/pine-cone.jpg',
     			'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg',
     			// translators: header image description 
     			'description' => __( 'Pine Cone', 'hivequeen' )
     		),
     		'chessboard' => array(
     			'url' => '%s/images/headers/chessboard.jpg',
     			'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg',
     			// translators: header image description 
     			'description' => __( 'Chessboard', 'hivequeen' )
     		),
     		'lanterns' => array(
     			'url' => '%s/images/headers/lanterns.jpg',
     			'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg',
     			// translators: header image description 
     			'description' => __( 'Lanterns', 'hivequeen' )
     		),
     		'willow' => array(
     			'url' => '%s/images/headers/willow.jpg',
     			'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg',
     			// translators: header image description 
     			'description' => __( 'Willow', 'hivequeen' )
     		),
     		'hanoi' => array(
     			'url' => '%s/images/headers/hanoi.jpg',
     			'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg',
     			// translators: header image description 
     			'description' => __( 'Hanoi Plant', 'hivequeen' )
     		)
     	) );
     */
 }
Exemplo n.º 3
0
/**
 * Implements Twenty Eleven theme options into Customizer
 *
 * @since HiveQueen Theme 0.1
 *
 * @param object $hq_customize Customizer object.
 */
function hivequeen_customize_register($hq_customize)
{
    $hq_customize->get_setting('blogname')->transport = 'postMessage';
    $hq_customize->get_setting('blogdescription')->transport = 'postMessage';
    $hq_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $options = hivequeen_get_theme_options();
    $defaults = hivequeen_get_default_theme_options();
    $hq_customize->add_setting('hivequeen_theme_options[color_scheme]', array('default' => $defaults['color_scheme'], 'type' => 'option', 'capability' => 'edit_theme_options'));
    $schemes = hivequeen_color_schemes();
    $choices = array();
    foreach ($schemes as $scheme) {
        $choices[$scheme['value']] = $scheme['label'];
    }
    $hq_customize->add_control('hivequeen_color_scheme', array('label' => __('Color Scheme', 'hivequeen'), 'section' => 'colors', 'settings' => 'hivequeen_theme_options[color_scheme]', 'type' => 'radio', 'choices' => $choices, 'priority' => 5));
    // Link Color (added to Color Scheme section in Customizer)
    $hq_customize->add_setting('hivequeen_theme_options[link_color]', array('default' => hivequeen_get_default_link_color($options['color_scheme']), 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options'));
    $hq_customize->add_control(new HQ_Customize_Color_Control($hq_customize, 'link_color', array('label' => __('Link Color', 'hivequeen'), 'section' => 'colors', 'settings' => 'hivequeen_theme_options[link_color]')));
    // Default Layout
    $hq_customize->add_section('hivequeen_layout', array('title' => __('Layout', 'hivequeen'), 'priority' => 50));
    $hq_customize->add_setting('hivequeen_theme_options[theme_layout]', array('type' => 'option', 'default' => $defaults['theme_layout'], 'sanitize_callback' => 'sanitize_key'));
    $layouts = hivequeen_layouts();
    $choices = array();
    foreach ($layouts as $layout) {
        $choices[$layout['value']] = $layout['label'];
    }
    $hq_customize->add_control('hivequeen_theme_options[theme_layout]', array('section' => 'hivequeen_layout', 'type' => 'radio', 'choices' => $choices));
}