Skip to content

Instantly share code, notes, and snippets.

@BinaryMoon
Created September 27, 2018 10:02
Show Gist options
  • Save BinaryMoon/624575d69a1e998d3579fe0efdcca483 to your computer and use it in GitHub Desktop.
Save BinaryMoon/624575d69a1e998d3579fe0efdcca483 to your computer and use it in GitHub Desktop.
Change the header image size for the Opti WordPress theme.
<?php
/**
* Plugin Name: Change Header Image Size
* Plugin URI: https://prothemedesign.com
* Description: Change the size of the header image in Opti.
* Author: Ben Gillbanks
* Version: 1.0
* Author URI: https://prothemedesign.com
*/
/**
* Change the header width.
*
* @param int $old_width Old width, we can ignore it.
* @return int
*/
function opti_new_header_width( $old_width ) {
return 1200;
}
add_filter( 'opti_header_width', 'opti_new_header_width' );
/**
* Change the header height.
*
* @param int $old_height Old height, we can ignore it.
* @return int
*/
function opti_new_header_height( $old_height ) {
return 500;
}
add_filter( 'opti_header_height', 'opti_new_header_height' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment