示例#1
0
/**
 * JV Allinone setup.
 *
 * Sets up theme defaults and registers the various WordPress features that
 * JV Allinone supports.
 *
 * @uses load_theme_textdomain() For translation/localization support.
 * @uses add_editor_style() To add a Visual Editor stylesheet.
 * @uses add_theme_support() To add support for post thumbnails, automatic feed links,
 * 	custom background, and post formats.
 * @uses register_nav_menu() To add support for navigation menus.
 * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
 *
 * @since JV Allinone 1.0
 */
function allinone_setup()
{
    /*
     * Makes JV Allinone available for translation.
     *
     * Translations can be added to the /languages/ directory.
     * If you're building a theme based on JV Allinone, use a find and replace
     * to change 'allinone' to the name of your theme in all the template files.
     */
    load_theme_textdomain('jv_allinone', get_template_directory() . '/languages');
    // This theme styles the visual editor with editor-style.css to match the theme style.
    add_editor_style();
    // Adds RSS feed links to <head> for posts and comments.
    add_theme_support('automatic-feed-links');
    /*
     * Let WordPress manage the document title.
     * By adding theme support, we declare that this theme does not use a
     * hard-coded <title> tag in the document head, and expect WordPress to
     * provide it for us.
     */
    add_theme_support('title-tag');
    // This theme supports a variety of post formats.
    add_theme_support('post-formats', array('aside', 'image', 'link', 'quote', 'status'));
    // This theme uses wp_nav_menu() in one location.
    register_nav_menu('primary', __('Primary Menu', 'jv_allinone'));
    /*
     * This theme supports custom background color and image,
     * and here we also set up the default background color.
     */
    add_theme_support('custom-background', array('default-color' => 'e6e6e6'));
    // This theme uses a custom image size for featured images, displayed on "standard" posts.
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(624, 9999);
    // Unlimited height, soft crop
    add_theme_support('jetpack-responsive-videos');
    // download sample data
    JVLibrary::downloadDataSanple();
}