Last active
June 18, 2022 10:36
-
-
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/
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 | |
/** | |
* 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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/