diff --git a/core/Image/Size.php b/core/Image/Size.php new file mode 100644 index 00000000..ce9b9b79 --- /dev/null +++ b/core/Image/Size.php @@ -0,0 +1,64 @@ +theme_mods = $theme_mods; + + $this->default_image = array( + 'navbar-brand-image' => array( + 'width' => 45, + 'height' => 45, + 'crop' => true, + ), + 'full-width' => array( + 'width' => 1140, + 'height' => 9999, + 'crop' => false, + ), + ); + } + + /** + * Register image size + */ + public function register() { + + foreach ( $this->default_image as $name => $params ) { + add_image_size( + $name, + $params['width'], + $params['height'], + $params['crop'] + ); + } + + } +} diff --git a/lib/bootstrap.php b/lib/bootstrap.php index afdf9f4d..ceacd73f 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -20,6 +20,7 @@ use ItalyStrap\Admin\Required_Plugins\Register as Required_Plugins; use ItalyStrap\Admin\Nav_Menu\Register_Nav_Menu_Edit as Register_Nav_Menu_Edit; +use ItalyStrap\Core\Image\Size as Size; use ItalyStrap\Core\Init\Init_Theme as Init_Theme; use ItalyStrap\Core\Navbar\Navbar as Navbar; use ItalyStrap\Core\Sidebars\Sidebars as Sidebars; @@ -29,7 +30,7 @@ /** * Load some static files. - * Bate version. + * Beta version. * * @var array */ @@ -86,6 +87,16 @@ */ $theme_mods = wp_parse_args( get_theme_mods(), $defaults ); +/** + * Register image site + * BETA VERSION + * + * @var ItalyStrap + */ +$image_size = new Size( $theme_mods ); +// $image_size->register(); +add_action( 'after_setup_theme', array( $image_size, 'register' ) ); + /** * Add field for adding glyphicon in menu *