Advertisement
Guest User

regency yithemes image_sizes

a guest
Nov 27th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.15 KB | None | 0 0
  1.  
  2. function yit_setup_theme() {
  3.  
  4.     /**
  5.      * Set up the content width value based on the theme's design.
  6.      *
  7.      * @see yit_content_width()
  8.      *
  9.      * @since Twenty Fourteen 1.0
  10.      */
  11.     if ( ! isset( $GLOBALS['content_width'] ) ) {
  12.         $GLOBALS['content_width'] = apply_filters( 'yit-container-width-std', 1170 );
  13.     }
  14.  
  15.     //This theme have a CSS file for the editor TinyMCE
  16.     add_editor_style( 'css/editor-style.css' );
  17.  
  18.     //This theme support post thumbnails
  19.     add_theme_support( 'post-thumbnails' );
  20.  
  21.     //This theme uses the menus
  22.     add_theme_support( 'menus' );
  23.  
  24.     //Add default posts and comments RSS feed links to head
  25.     add_theme_support( 'automatic-feed-links' );
  26.  
  27.     //This theme support post formats
  28.     add_theme_support( 'post-formats', apply_filters( 'yit_post_formats_support', array( 'gallery', 'audio', 'video', 'quote' ) ) );
  29.  
  30.     if ( ! defined( 'HEADER_TEXTCOLOR' ) )
  31.         define( 'HEADER_TEXTCOLOR', '' );
  32.  
  33.     // The height and width of your custom header. You can hook into the theme's own filters to change these values.
  34.     // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
  35.     define( 'HEADER_IMAGE_WIDTH', apply_filters( 'yiw_header_image_width', 1170 ) );
  36.     define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'yiw_header_image_height', 410 ) );
  37.  
  38.     // Don't support text inside the header image.
  39.     if ( ! defined( 'NO_HEADER_TEXT' ) )
  40.         define( 'NO_HEADER_TEXT', true );
  41.  
  42.     //This theme support custom header
  43.     add_theme_support( 'custom-header' );
  44.  
  45.     //This theme support custom backgrounds
  46.     add_theme_support( 'custom-backgrounds' );
  47.  
  48.     /*
  49.      * Switch default core markup for search form, comment form, and comments
  50.      * to output valid HTML5.
  51.      */
  52.     add_theme_support( 'html5', array(
  53.         'search-form', 'comment-form', 'comment-list',
  54.     ) );
  55.  
  56.     // We'll be using post thumbnails for custom header images on posts and pages.
  57.     // We want them to be 940 pixels wide by 198 pixels tall.
  58.     // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
  59.     // set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
  60.     $image_sizes = array(
  61.         'blog_small'                         => array( 283, 170, true ),
  62.         'blog_small_xl'                      => array( 406, 175, true ),
  63.         'blog_masonry'                       => array( 283, 0 ),
  64.         'blog_masonry_xl'                    => array( 420, 0 ),
  65.         'blog_big'                           => array( 1138, 547, true ),
  66.         'blog_big_xl'                        => array( 1776, 794, true ),
  67.         'blog_single_big'                    => array( 1138, 547, true ),
  68.         'blog_single_big_xl'                 => array( 1776, 794, true ),
  69.         'blog_section'                       => array( 116, 84, true ),
  70.         'blog_widget_compact'                => array( 84, 84, true ),
  71.         'portfolio_small'                    => array( 263, 325, true ),
  72.         'portfolio_small_xl'                 => array( 504, 623, true ),
  73.         'portfolio_thumb'                    => array( 65, 65, true ),
  74.         'portfolio_single_big_featured'      => array( 763, 532, true ),
  75.         'portfolio_single_big_featured_xl'   => array( 1175, 819, true ),
  76.         'portfolio_single_big_lookbook'      => array( 763, 0, false ),
  77.         'portfolio_single_big_lookbook_xl'   => array( 1175, 0, false ),
  78.         'testimonial_thumb'                  => array( 58, 58, true ),
  79.         'thumb_team_big'                     => array( 360, 262, true ),
  80.         'thumb_team_big_xl'                  => array( 420, 423, true ),
  81.         'featured_product_widget'            => array( 261, 324, true ),
  82.         'featured_product_widget_xl'         => array( 420, 521, true ),
  83.     );
  84.  
  85.  
  86.     $image_sizes = apply_filters( 'yit_add_image_size', $image_sizes );
  87.  
  88.     foreach ( $image_sizes as $id_size => $size ) {
  89.         add_image_size( $id_size, apply_filters( 'yit_' . $id_size . '_width', $size[0] ), apply_filters( 'yit_' . $id_size . '_height', $size[1] ), isset( $size[2] ) ? $size[2] : false );
  90.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement