• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP set_post_thumbnail_size函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中set_post_thumbnail_size函数的典型用法代码示例。如果您正苦于以下问题:PHP set_post_thumbnail_size函数的具体用法?PHP set_post_thumbnail_size怎么用?PHP set_post_thumbnail_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了set_post_thumbnail_size函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setup

/**
 * Theme setup
 */
function setup()
{
    // Enable features from Soil when plugin is activated
    // https://roots.io/plugins/soil/
    add_theme_support('soil-clean-up');
    add_theme_support('soil-nav-walker');
    add_theme_support('soil-nice-search');
    add_theme_support('soil-jquery-cdn');
    add_theme_support('soil-relative-urls');
    // Make theme available for translation
    // Community translations can be found at https://github.com/roots/sage-translations
    load_theme_textdomain('sage', get_template_directory() . '/lang');
    // Enable plugins to manage the document title
    // http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
    add_theme_support('title-tag');
    // Register wp_nav_menu() menus
    // http://codex.wordpress.org/Function_Reference/register_nav_menus
    register_nav_menus(['primary_navigation' => __('Primary Navigation', 'sage')]);
    // Enable post thumbnails
    // http://codex.wordpress.org/Post_Thumbnails
    // http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size
    // http://codex.wordpress.org/Function_Reference/add_image_size
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(1020, 900);
    // Enable post formats
    // http://codex.wordpress.org/Post_Formats
    //add_theme_support('post-formats', ['aside', 'gallery', 'link', 'image', 'quote', 'video', 'audio']);
    // Enable HTML5 markup support
    // http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
    add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']);
    // Use main stylesheet for visual editor
    // To add custom styles edit /assets/styles/layouts/_tinymce.scss
    add_editor_style(Assets\asset_path('styles/main.css'));
}
开发者ID:jchck,项目名称:bow-tie,代码行数:37,代码来源:setup.php


示例2: actions_setup

 /**
  * Sets up theme defaults and registers support for various WordPress 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 for post thumbnails.
  */
 function actions_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on actions, use a find and replace
      * to change 'actions' to the name of your theme in all the template files.
      */
     load_theme_textdomain('actions');
     /**
      * Add default posts and comments RSS feed links to head.
      */
     add_theme_support('automatic-feed-links');
     add_theme_support('customize-selective-refresh-widgets');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(640, 300);
     // This theme uses wp_nav_menu() in one locations.
     register_nav_menus(array('primary' => esc_html__('Primary Menu', 'actions')));
     /*
      * Switch default core markup for search form, comment form, comments, galleries, captions and widgets
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'widgets'));
     /*
      * Enable support for site logo.
      */
     add_theme_support('custom-logo', array('height' => 150, 'width' => 250, 'flex-height' => true, 'header-text' => array('site-title', 'site-description')));
     // Declare support for title theme feature
     add_theme_support('title-tag');
 }
开发者ID:WPDevHQ,项目名称:actions,代码行数:42,代码来源:setup.php


示例3: renova_setup

function renova_setup()
{
    //Feed links
    add_theme_support('automatic-feed-links');
    //Nav menu
    register_nav_menu('primary', __('Primary Menu', 'renovalang'));
    //Sidebar
    $args = array('name' => __('renova_side', 'renovalang'), 'id' => 'renova01', 'description' => '', 'class' => '', 'before_widget' => '<section id="%1$s"  class="blog-side-panel %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2>', 'after_title' => '</h2>');
    register_sidebar($args);
    //Content width
    if (!isset($content_width)) {
        $content_width = 900;
    }
    //Initiate custom post types
    add_action('init', 'renova_post_types');
    add_action('init', 'renova_post_gallery');
    //Load the text domain
    load_theme_textdomain('renovalang', get_template_directory() . '/languages');
    //Post Thumbnails
    add_theme_support('post-thumbnails', array('portfolio_item', 'gallery_item', 'post'));
    //Post formats
    add_theme_support('post-formats', array('image', 'audio', 'link', 'quote', 'video'));
    set_post_thumbnail_size(300, 300, true);
    // Standard Size Thumbnails
    //Function to crop all thumbnails
    if (false === get_option("thumbnail_crop")) {
        add_option("thumbnail_crop", "1");
    } else {
        update_option("thumbnail_crop", "1");
    }
}
开发者ID:solsticehc,项目名称:citadel,代码行数:31,代码来源:functions.php


示例4: flexy_setup

/**
 * Flexy  setup.
 *
 * Sets up theme defaults and registers the various WordPress features that
 * Flexy  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 Flexy 1.0
 */
function flexy_setup()
{
    add_theme_support('title-tag');
    // Set up the content width value based on the theme's design and stylesheet.
    if (!isset($content_width)) {
        global $content_width;
        $content_width = 625;
    }
    /*
     * Makes Flexy  available for translation.
     *
     * Translations can be added to the /languages/ directory.
     * If you're building a theme based on Flexy , use a find and replace
     * to change 'flexy' to the name of your theme in all the template files.
     */
    load_theme_textdomain('flexy', 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');
    // 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', 'flexy'));
    /*
     * 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(350, 350);
    // Unlimited height, soft crop
}
开发者ID:ningenis,项目名称:pvjtt,代码行数:49,代码来源:functions.php


示例5: portfilo_portfolio_theme_setup

 function portfilo_portfolio_theme_setup()
 {
     add_theme_support('title-tag');
     add_theme_support('custom-background');
     $args = array('flex-width' => true, 'width' => 1400, 'flex-height' => true, 'height' => 600, 'default-image' => get_template_directory_uri() . '/images/overlay.jpg');
     add_theme_support('custom-header', $args);
     /* ---------------------------------------------------------------------------
      * Loads Theme Textdomain
      * --------------------------------------------------------------------------- */
     load_theme_textdomain('portfilo', PORTFILO_LANG_DIR);
     add_theme_support('automatic-feed-links');
     add_theme_support('woocommerce');
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(260, 146, false);
     // admin - featured image
     add_image_size('portfilo_50x50', 50, 50, false);
     // admin - lists
     add_image_size('portfilo-aboutus-thumbnail', 1140, 640, true);
     add_image_size('portfilo-blog-listing-thumbnail', 458, 244, true);
     add_image_size('portfilo-blog-detail-thumbnail', 750, 400, true);
     add_image_size('portfilo-slider-thumbnail', 1400, 786, true);
     /* ---------------------------------------------------------------------------
      * Registers a menu location to use with navigation menus.
      * --------------------------------------------------------------------------- */
     /*register_nav_menu('primary', __('Main menu', 'portfilo'));
       register_nav_menu('footer', __('Footer menu', 'portfilo'));*/
     register_nav_menus(array('primary' => __('Primary Navigation', 'portfilo'), 'secondary' => __('Secondary Navigation', 'portfilo')));
     add_action('add_meta_boxes', 'portfilo_Slider');
     add_action('save_post', 'PortfiloSaveHomePageSlider');
 }
开发者ID:lillian7,项目名称:wordpress,代码行数:30,代码来源:theme-functions.php


示例6: startertheme_setup

 /**
  * Sets up theme defaults and registers support for various WordPress 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 for post thumbnails.
  *
  * @since Starter Theme 1.0f
  */
 function startertheme_setup()
 {
     /* 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');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(825, 510, true);
     /**
      * Register WP Nav Menu
      * This theme uses wp_nav_menu() in two locations.
      */
     /**
      * 
      */
     register_nav_menus(array('main_menu' => __('Main Menu', 'startertheme'), 'footer_menu' => __('Footer Menu', 'startertheme')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
 }
开发者ID:katarinatang,项目名称:peggytang,代码行数:37,代码来源:functions.php


示例7: lwfitness_setup

 function lwfitness_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      */
     load_theme_textdomain('lwfitness', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     /*
      * Let WordPress manage the document title.
      */
     add_theme_support('title-tag');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(825, 510, true);
     // Add menus.
     register_nav_menus(array('primary' => __('Primary Menu', 'lwfitness'), 'social' => __('Social Links Menu', 'lwfitness')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     /*
      * Enable support for Post Formats.
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'));
 }
开发者ID:lexdencs,项目名称:lwfitness4all,代码行数:30,代码来源:functions.php


示例8: reef_setup

 function reef_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on twentyfifteen, use a find and replace
      * to change 'twentyfifteen' to the name of your theme in all the template files
      */
     load_theme_textdomain('TEXTDOMAIN', get_template_directory() . '/languages');
     /*
      * 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');
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(200, 200, true);
     add_image_size('full-image', 1100, 1100);
     //        add_image_size( 'big-image', 750, 750 );
     //        add_image_size( 'medium-image', 500, 500 );
     add_image_size('small-image', 250, 250, true);
     add_image_size('panoramic-image', 800, 400, true);
     // This theme uses wp_nav_menu() in two locations.
     register_nav_menus(array('cat' => __('Category menu', 'TEXTDOMAIN'), 'langs' => __('Language menu', 'TEXTDOMAIN')));
 }
开发者ID:Boooober,项目名称:reef,代码行数:31,代码来源:functions.php


示例9: plandd_setup

/**
 * Setup
 */
function plandd_setup()
{
    /**
     * Registrar formatos de miniaturas
     */
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(242, 220, true);
    if (function_exists('add_image_size')) {
        add_image_size('destaque.grande', 960, 395, true);
        add_image_size('destaque.medio', 300, 187, true);
        add_image_size('destaque.pequeno', 140, 98, true);
        add_image_size('destaque.rodape', 300, 286, true);
        add_image_size('destaque.editoria', 300, 286, true);
        add_image_size('destaque.colunista', 80, 80, true);
    }
    function new_excerpt_length($length)
    {
        return 20;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    remove_filter('the_excerpt', 'wpautop');
    // sem paragrafo no resumo
    /**
     * Menus
     */
    register_nav_menus(array('primary' => __('Menu principal', 'plandd')));
}
开发者ID:plandd,项目名称:pbagora,代码行数:30,代码来源:functions.php


示例10: blackoot_setup

function blackoot_setup()
{
    /* Translation support
     * Translations can be added to the /languages directory.
     * A .pot template file is included to get you started
     */
    load_theme_textdomain('blackoot-lite', get_template_directory() . '/languages');
    // Content Width
    global $content_width;
    if (!isset($content_width)) {
        $content_width = 680;
    }
    /* Feed links support */
    add_theme_support('automatic-feed-links');
    /* Register menus */
    register_nav_menu('primary', 'Navigation menu');
    register_nav_menu('footer-menu', 'Footer menu');
    /* Title tag support */
    add_theme_support('title-tag');
    /* Post Thumbnails Support */
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(680, 300, true);
    /* Custom header support */
    add_theme_support('custom-header', array('header-text' => false, 'width' => 1000, 'height' => 364, 'flex-height' => true));
    /* Custom background support */
    add_theme_support('custom-background', array('default-color' => '111111', 'default-image' => get_template_directory_uri() . '/img/zwartevilt.png'));
}
开发者ID:Torchwood7,项目名称:torchwood-site,代码行数:27,代码来源:functions.php


示例11: _action_theme_setup

 function _action_theme_setup()
 {
     /*
      * Make Theme available for translation.
      */
     load_theme_textdomain('unyson', get_template_directory() . '/languages');
     // This theme styles the visual editor to resemble the theme style.
     add_editor_style(array('css/editor-style.css', fw_theme_font_url()));
     // Add RSS feed links to <head> for posts and comments.
     add_theme_support('automatic-feed-links');
     // Enable support for Post Thumbnails, and declare two sizes.
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(811, 372, true);
     add_image_size('fw-theme-full-width', 1038, 576, true);
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     /*
      * Enable support for Post Formats.
      * See http://codex.wordpress.org/Post_Formats
      */
     add_theme_support('post-formats', array('aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery'));
     // Add support for featured content.
     add_theme_support('featured-content', array('featured_content_filter' => 'fw_theme_get_featured_posts', 'max_posts' => 6));
     // This theme uses its own gallery styles.
     add_filter('use_default_gallery_style', '__return_false');
 }
开发者ID:Umeeshh,项目名称:Scratch-Theme,代码行数:29,代码来源:hooks.php


示例12: graphy_setup

 /**
  * Sets up theme defaults and registers support for various WordPress 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 for post thumbnails.
  */
 function graphy_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      * If you're building a theme based on Graphy, use a find and replace
      * to change 'graphy' to the name of your theme in all the template files
      */
     load_theme_textdomain('graphy', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head.
     add_theme_support('automatic-feed-links');
     /*
      * Switches default core markup for search form, comment form,
      * and comments to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list'));
     /*
      * Enable support for Post Thumbnails on posts and pages.
      *
      * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
      */
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(800);
     add_image_size('graphy-page-thumbnail', 1260, 350, true);
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Menu', 'graphy')));
     // Enable support for Post Formats.
     add_theme_support('post-formats', array('aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'));
     // Setup the WordPress core custom header feature.
     add_theme_support('custom-header', apply_filters('graphy_custom_header_args', array('default-image' => '', 'width' => 1260, 'height' => 350, 'flex-height' => false, 'header-text' => false)));
     // This theme styles the visual editor to resemble the theme style.
     add_editor_style(array('css/editor-style.css', graphy_fonts_url()));
     // This theme uses its own gallery styles.
     add_filter('use_default_gallery_style', '__return_false');
 }
开发者ID:juansalvatella,项目名称:dosnoventa,代码行数:42,代码来源:functions.php


示例13: galanight_setup

/**
 * GalaNight theme basic setup.
 *  
*/
function galanight_setup()
{
    // Makes GalaNight available for translation.
    load_theme_textdomain('galanight', get_template_directory() . '/languages');
    // This theme styles the visual editor to resemble the theme style.
    $galanight_font_url = add_query_arg('family', 'Oswald', "//fonts.googleapis.com/css");
    add_editor_style(array('editor-style.css', $galanight_font_url));
    // Adds RSS feed links to <head> for posts and comments.
    add_theme_support('automatic-feed-links');
    // This theme supports custom background color and image.
    $defaults = array('default-color' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '');
    add_theme_support('custom-background', $defaults);
    // This theme supports post thumbnails.
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(1170, 9999);
    // This theme supports a custom header image.
    $args = array('width' => 1800, 'height' => 400, 'flex-width' => true, 'flex-height' => true, 'header-text' => false, 'random-default' => true);
    add_theme_support('custom-header', $args);
    // This theme supports the Title Tag feature.
    add_theme_support('title-tag');
    // This theme supports the WooCommerce plugin.
    add_theme_support('woocommerce');
    global $content_width;
    if (!isset($content_width)) {
        $content_width = 840;
    }
}
开发者ID:mystified7545,项目名称:MyBlog,代码行数:31,代码来源:functions.php


示例14: my_setup

 function my_setup()
 {
     // This theme styles the visual editor with editor-style.css to match the theme style.
     add_editor_style();
     // This theme uses post thumbnails
     if (function_exists('add_theme_support')) {
         // Added in 2.9
         add_theme_support('post-thumbnails');
         set_post_thumbnail_size(230, 214, true);
         // Normal post thumbnails
         add_image_size('post-thumbnail-xl', 692, 300, true);
         // Portfolio Extra Large Thumbnail
         add_image_size('slider-post-thumbnail', 990, 424, true);
         // Slider Thumbnail
         add_image_size('small-post-thumbnail', 130, 121, true);
         // Small Thumbnail
         add_image_size('testi-thumbnail', 120, 120, true);
         // Testimonial Thumbnail
         add_image_size('extra-thumbnail', 150, 174, true);
         // Extra Thumbnail
     }
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // custom menu support
     add_theme_support('menus');
     if (function_exists('register_nav_menus')) {
         register_nav_menus(array('header_menu' => 'Header Menu', 'footer_menu' => 'Footer Menu'));
     }
 }
开发者ID:n1ss,项目名称:acreet,代码行数:29,代码来源:theme-init.php


示例15: eminent_setup

 function eminent_setup()
 {
     // This theme uses wp_nav_menu() in one locations.
     register_nav_menus(array('primary' => __('Main Menu', 'eminent')));
     global $eminent_content_width;
     if (!isset($content_width)) {
         $content_width = 900;
     }
     /*
      * Make eminent theme available for translation.
      */
     load_theme_textdomain('eminent', get_template_directory() . '/languages');
     // This theme styles the visual editor to resemble the theme style.
     add_editor_style(array('css/editor-style.css', eminent_font_url()));
     // Add RSS feed links to <head> for posts and comments.
     add_theme_support('automatic-feed-links');
     add_theme_support('title-tag');
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(770, 350, true);
     add_image_size('eminent-blog-thumbnail-image', 770, 400, true);
     add_image_size('eminent-blog-thumbnail-image-home', 370, 263, true);
     /*        
      * Switch default core markup for search form, comment form, and comments        
      * to output valid HTML5.        
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list'));
     // Add support for featured content.
     add_theme_support('featured-content', array('featured_content_filter' => 'eminent_get_featured_posts', 'max_posts' => 6));
     add_theme_support('custom-header', apply_filters('eminent_custom_header_args', array('uploads' => true, 'flex-height' => true, 'default-text-color' => '#e36229', 'header-text' => true, 'height' => '120', 'width' => '1260')));
     add_theme_support('custom-background', apply_filters('eminent_custom_background_args', array('default-color' => 'f5f5f5')));
     // This theme uses its own gallery styles.
     add_filter('use_default_gallery_style', '__return_false');
 }
开发者ID:dimiske,项目名称:gaastra,代码行数:33,代码来源:functions.php


示例16: stargazer_register_image_sizes

/**
 * Registers custom image sizes for the theme.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function stargazer_register_image_sizes()
{
    /* Sets the 'post-thumbnail' size. */
    set_post_thumbnail_size(175, 131, true);
    /* Adds the 'stargazer-full' image size. */
    add_image_size('stargazer-full', 1025, 500, false);
}
开发者ID:htmELS,项目名称:stargazer,代码行数:14,代码来源:stargazer.php


示例17: origami_setup

 /**
  * Setup Origami.
  * 
  * @action after_setup_theme
  */
 function origami_setup()
 {
     so_settings_init();
     global $content_width;
     if (!isset($content_width)) {
         $content_width = 904;
     }
     // Load the text domains
     load_theme_textdomain('origami', get_template_directory() . '/languages');
     add_theme_support('automatic-feed-links');
     // Origami supports post formats
     add_theme_support('post-formats', array('gallery', 'image', 'video', 'aside', 'link', 'quote', 'status', 'chat'));
     // Origami supports post thumbnails
     add_theme_support('post-thumbnails');
     // Create the primary menu area
     register_nav_menu('primary', 'Primary Menu');
     // Add support for custom backgrounds.
     add_theme_support('custom-background', array('default-color' => 'f0eeeb', 'default-image' => get_template_directory_uri() . '/images/bg.png'));
     // Use custom headers for site logo
     add_theme_support('custom-header', array('flex-height' => true, 'flex-width' => true, 'header-text' => false));
     add_editor_style();
     // Set up the image sizes
     set_post_thumbnail_size(904, 400, true);
     add_image_size('post-thumbnail-mobile', 480, 420, true);
     add_image_size('post-thumbnail-full', 904, 904, false);
     add_image_size('origami-slider', 904, 500, true);
 }
开发者ID:sudocoda,项目名称:mikelovescomics.com,代码行数:32,代码来源:functions.php


示例18: nimbus_setup

 function nimbus_setup()
 {
     // Localization
     $lang_local = get_template_directory() . '/lang';
     load_theme_textdomain('nimbus', $lang_local);
     // Register Thumbnail Sizes
     add_theme_support('post-thumbnails');
     set_post_thumbnail_size(1170, 9999, true);
     add_image_size('nimbus_270_170', 270, 170, true);
     add_image_size('nimbus_740_420', 740, 420, true);
     add_image_size('nimbus_105_90', 105, 90, true);
     add_image_size('nimbus_1140_420', 1140, 420, true);
     add_image_size('nimbus_1130_410', 1130, 410, true);
     // Load feed links
     add_theme_support('automatic-feed-links');
     // Support Custom Background
     $nimbus_custom_background_defaults = array('default-color' => 'ffffff');
     add_theme_support('custom-background', $nimbus_custom_background_defaults);
     // Set Content Width
     global $content_width;
     if (!isset($content_width)) {
         $content_width = 720;
     }
     // Register Menus
     register_nav_menu('primary', __('Primary Menu', 'nimbus'));
 }
开发者ID:CoderDojo-Guadalajara,项目名称:coderdojo-guadalajara,代码行数:26,代码来源:functions.php


示例19: twentytwelve_setup

/**
 * Twenty Twelve setup.
 *
 * Sets up theme defaults and registers the various WordPress features that
 * Twenty Twelve 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 Twenty Twelve 1.0
 */
function twentytwelve_setup()
{
    /*
     * Makes Twenty Twelve available for translation.
     *
     * Translations can be added to the /languages/ directory.
     * If you're building a theme based on Twenty Twelve, use a find and replace
     * to change 'twentytwelve' to the name of your theme in all the template files.
     */
    load_theme_textdomain('twentytwelve', 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');
    // 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', 'twentytwelve'));
    /*
     * 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
}
开发者ID:liyanouou,项目名称:wordpress,代码行数:43,代码来源:functions.php


示例20: my_setup

 function my_setup()
 {
     // This theme styles the visual editor with editor-style.css to match the theme style.
     add_editor_style();
     // This theme uses post thumbnails
     if (function_exists('add_theme_support')) {
         // Added in 2.9
         add_theme_support('post-thumbnails');
         set_post_thumbnail_size(235, 148, true);
         // Normal post thumbnails
         add_image_size('post-thumbnail-xl', 578, 250, true);
         // Portfolio Extra Large Thumbnail
         add_image_size('portfolio-post-thumbnail', 268, 168, true);
         // Portfolio Thumbnail
         add_image_size('portfolio-post-thumbnail-small', 196, 148, true);
         // Portfolio Small Thumbnail
         add_image_size('portfolio-post-thumbnail-large', 417, 208, true);
         // Portfolio Large Thumbnail
         add_image_size('portfolio-post-thumbnail-xl', 498, 238, true);
         // Portfolio Extra Large Thumbnail
         add_image_size('small-post-thumbnail', 139, 139, true);
         // Small Thumbnail
     }
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // custom menu support
     add_theme_support('menus');
     if (function_exists('register_nav_menus')) {
         register_nav_menus(array('header_menu' => 'Header Menu'));
     }
 }
开发者ID:anaved,项目名称:wordpress-tinkering,代码行数:31,代码来源:theme-init.php



注:本文中的set_post_thumbnail_size函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP set_post_type函数代码示例发布时间:2022-05-15
下一篇:
PHP set_post_thumbnail函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap