Last active
September 19, 2024 12:40
-
-
Save jameskoster/1695731 to your computer and use it in GitHub Desktop.
Revisions
-
jameskoster revised this gist
Oct 3, 2014 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,17 @@ /** * Hook in on activation */ /** * Define image sizes */ function yourtheme_woocommerce_image_dimensions() { global $pagenow; if ( ! isset( $_GET['activated'] ) || $pagenow != 'themes.php' ) { return; } $catalog = array( 'width' => '400', // px 'height' => '400', // px @@ -31,4 +35,6 @@ function yourtheme_woocommerce_image_dimensions() { update_option( 'shop_catalog_image_size', $catalog ); // Product category thumbs update_option( 'shop_single_image_size', $single ); // Single product image update_option( 'shop_thumbnail_image_size', $thumbnail ); // Image gallery thumbs } add_action( 'after_switch_theme', 'yourtheme_woocommerce_image_dimensions', 1 ); -
jameskoster revised this gist
Mar 13, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ * Define image sizes */ function yourtheme_woocommerce_image_dimensions() { $catalog = array( 'width' => '400', // px 'height' => '400', // px 'crop' => 1 // true -
jameskoster revised this gist
Mar 13, 2013 . 1 changed file with 27 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,34 @@ <?php /** * Hook in on activation */ global $pagenow; if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 ); /** * Define image sizes */ function yourtheme_woocommerce_image_dimensions() { $catalog = array( 'width' => '400', // px 'height' => '400', // px 'crop' => 1 // true ); $single = array( 'width' => '600', // px 'height' => '600', // px 'crop' => 1 // true ); $thumbnail = array( 'width' => '120', // px 'height' => '120', // px 'crop' => 0 // false ); // Image sizes update_option( 'shop_catalog_image_size', $catalog ); // Product category thumbs update_option( 'shop_single_image_size', $single ); // Single product image update_option( 'shop_thumbnail_image_size', $thumbnail ); // Image gallery thumbs } -
jameskoster revised this gist
Feb 8, 2012 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,11 +22,8 @@ function yourtheme_woocommerce_image_dimensions() { // Hard Crop [0 = false, 1 = true] update_option( 'woocommerce_thumbnail_image_crop', 0 ); update_option( 'woocommerce_single_image_crop', 0 ); update_option( 'woocommerce_catalog_image_crop', 0 ); } ?> -
jameskoster revised this gist
Jan 28, 2012 . No changes.There are no files selected for viewing
-
jameskoster revised this gist
Jan 28, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php /*-----------------------------------------------------------------------------------*/ /* Hook in on activation */ /*-----------------------------------------------------------------------------------*/ @@ -27,4 +28,5 @@ function yourtheme_woocommerce_image_dimensions() { update_option( 'woocommerce_catalog_image_crop', 0 ); update_option( 'woocommerce_catalog_image_crop', 0 ); } ?> -
jameskoster revised this gist
Jan 28, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,13 @@ /*-----------------------------------------------------------------------------------*/ global $pagenow; if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action('init', 'yourtheme_woocommerce_image_dimensions', 1); /*-----------------------------------------------------------------------------------*/ /* Define image sizes / hard crop */ /*-----------------------------------------------------------------------------------*/ function yourtheme_woocommerce_image_dimensions() { // Image sizes update_option( 'woocommerce_thumbnail_image_width', '200' ); // Image gallery thumbs -
jameskoster revised this gist
Jan 28, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action('init', 'set_woocommerce_image_dimensions', 1); /*-----------------------------------------------------------------------------------*/ /* Define image sizes / hard crop */ /*-----------------------------------------------------------------------------------*/ function set_woocommerce_image_dimensions() { -
jameskoster revised this gist
Jan 28, 2012 . No changes.There are no files selected for viewing
-
jameskoster created this gist
Jan 28, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ /*-----------------------------------------------------------------------------------*/ /* Hook in on activation */ /*-----------------------------------------------------------------------------------*/ global $pagenow; if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action('init', 'set_woocommerce_image_dimensions', 1); /*-----------------------------------------------------------------------------------*/ /* Install */ /*-----------------------------------------------------------------------------------*/ function set_woocommerce_image_dimensions() { // Image sizes update_option( 'woocommerce_thumbnail_image_width', '200' ); // Image gallery thumbs update_option( 'woocommerce_thumbnail_image_height', '200' ); update_option( 'woocommerce_single_image_width', '888' ); // Featured product image update_option( 'woocommerce_single_image_height', '888' ); update_option( 'woocommerce_catalog_image_width', '350' ); // Product category thumbs update_option( 'woocommerce_catalog_image_height', '350' ); // Hard Crop [0 = false, 1 = true] update_option( 'woocommerce_thumbnail_image_crop', 0 ); update_option( 'woocommerce_thumbnail_image_crop', 0 ); update_option( 'woocommerce_single_image_crop', 0 ); update_option( 'woocommerce_single_image_crop', 0 ); update_option( 'woocommerce_catalog_image_crop', 0 ); update_option( 'woocommerce_catalog_image_crop', 0 ); }