Skip to content

Instantly share code, notes, and snippets.

@Codevz
Last active June 18, 2022 10:36
Show Gist options
  • Save Codevz/d97339aee1e9b2ba74744b8cd5d52f74 to your computer and use it in GitHub Desktop.
Save Codevz/d97339aee1e9b2ba74744b8cd5d52f74 to your computer and use it in GitHub Desktop.
XTRA WP Theme - Change posts featured image size on archive pages, https://xtratheme.com/
<?php
/**
* With this function you can modify single post featured image including post format HTML data.
*
* @var $value HTML of featured image and post format.
*
* @return string
*/
function codevz_xtra_archive_thumbnail_size( $size, $post_type ) {
// Some available: thumbnail, medium, full, codevz_360_320, codevz_600_600, codevz_1200_500, codevz_600_9999
// You can set a defined size here.
if ( $post_type === 'post' ) {
return 'medium';
}
}
add_filter( 'codevz/archive/thumbnail_size', 'codevz_xtra_archive_thumbnail_size', 10, 2 );
@Codevz
Copy link
Author

Codevz commented Jan 12, 2022

If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment