Created
June 14, 2013 13:04
-
-
Save Perun/5781665 to your computer and use it in GitHub Desktop.
Zusätzliche Bilderformate in WordPress definieren und im backend auswählbar machen. Siehe: http://www.perun.net/2013/06/13/wordpress-zusaetzliche-bildergroessen-definieren/
This file contains 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 characters
<?php | |
// Unterstützung für Vorschaubilder sollte schon aktiv sein | |
add_theme_support('post-thumbnails'); | |
// die gewünschten neuen Bilderformate | |
add_image_size('vorschaubild', 125, 125, true); | |
add_image_size('produktbild', 500, 350); | |
// macht die neuen Formate im Backend sichtbar und auswählbar | |
add_filter('image_size_names_choose', 'custom_image_sizes_choose'); | |
function custom_image_sizes_choose($sizes) { | |
$custom_sizes = array( | |
'vorschaubild' => 'Vorschaubild', | |
'produktbild' => 'Produktbild' | |
); | |
return array_merge($sizes, $custom_sizes); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment