Ejemplo n.º 1
0
function anno_setup()
{
    $path = trailingslashit(TEMPLATEPATH);
    // i18n support
    load_theme_textdomain('anno', $path . 'languages');
    $locale = get_locale();
    $locale_file = $path . '/languages/' . $locale . '.php';
    if (is_readable($locale_file)) {
        require_once $locale_file;
    }
    add_theme_support('automatic-feed-links');
    add_theme_support('post-thumbnails', array('article', 'post'));
    add_image_size('post-excerpt', 140, 120, true);
    add_image_size('post-teaser', 100, 79, true);
    add_image_size('featured', 270, 230, true);
    add_image_size('header', 500, 500, false);
    $header_image = Anno_Keeper::retrieve('header_image');
    $header_image->add_custom_image_header();
    $menus = array('main' => 'Main Menu (Header)', 'secondary' => 'Secondary Menu (Header)', 'footer' => 'Footer Menu');
    register_nav_menus($menus);
    $sidebar_defaults = array('before_widget' => '<aside id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h1 class="title">', 'after_title' => '</h1>');
    register_sidebar(array_merge($sidebar_defaults, array('name' => __('Default Sidebar', 'anno'), 'id' => 'default')));
    register_sidebar(array_merge($sidebar_defaults, array('name' => __('Page Sidebar', 'anno'), 'id' => 'sidebar-page', 'description' => __('This sidebar will be shown on Pages.', 'anno'))));
    register_sidebar(array_merge($sidebar_defaults, array('name' => __('Article Sidebar', 'anno'), 'id' => 'sidebar-article', 'description' => __('This sidebar will be shown single Articles.', 'anno'))));
    register_sidebar(array_merge($sidebar_defaults, array('name' => __('Masthead Teasers', 'anno'), 'id' => 'masthead', 'description' => __('Display items on the home page masthead.', 'anno'), 'before_widget' => '<aside id="%1$s" class="teaser clearfix %2$s">')));
    // Customize the Carrington Core Admin Settings Form Title
    add_filter('cfct_admin_settings_menu', 'anno_admin_settings_menu_form_title');
    add_filter('cfct_admin_settings_form_title', 'anno_admin_settings_menu_form_title');
    add_filter('cfct_admin_settings_title', 'anno_admin_settings_menu_form_title');
}
Ejemplo n.º 2
0
 /**
  * @param array $output_dimensions
  * @param string $image_size
  */
 public function __construct($image_size, $output_dimensions = array(), $default_image_path = '')
 {
     try {
         $utils = Anno_Keeper::retrieve('utils');
     } catch (Exception $e) {
         $utils = Anno_Keeper::keep('utils', new Anno_Template_Utils());
     }
     $this->utils = $utils;
     if (count($output_dimensions)) {
         $this->dimensions = array($output_dimensions[0], $output_dimensions[1]);
     } else {
         global $_wp_additional_image_sizes;
         $image_info = $_wp_additional_image_sizes[$image_size];
         $this->dimensions = array($image_info['width'], $image_info['height']);
     }
     $this->default_image_path = $default_image_path;
 }