Skip to content

Instantly share code, notes, and snippets.

@Mamaduka
Last active December 20, 2015 11:09
Show Gist options
  • Save Mamaduka/6120727 to your computer and use it in GitHub Desktop.
Save Mamaduka/6120727 to your computer and use it in GitHub Desktop.
<?php
/**
* Add specific thumbnail size for posts and pages.
*/
function wysija_set_thumbnail_size() {
$model_config = WYSIJA::get( 'config', 'model' );
// Holds arry of thumbnail sizes
$sizes = $model_config->getValue('thumb_size');
add_image_size( 'single-post-thumbnail', $sizes['width'], $sizes['height'], true );
}
add_action( 'after_setup_theme', 'wysija_set_thumbnail_size' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment