-
lsitlabs
Hi,
I’ve set up the blog page (posts archive) to display in 3 columns, with the first article styled as “featured.”
Under “Customizer > Layout > Blog > Media Attachment Size”, I’ve set the “medium” size, which works well for the articles in columns. However, I’d like to use a larger image size specifically for the featured column, as it’s set to 100% width in CSS.
Is there a way to adjust the media size only for that featured article?
-
Yes, try this PHP code:
add_filter( 'generate_page_header_default_size', function( $size ) { $classes = get_post_class(); if ( in_array( 'featured-column', $classes ) ) { return 'full'; //change full to the size you want to use } return $size; }, 20 );
Adding PHP: https://docs.generatepress.com/article/adding-php/
-
lsitlabs
Hi Ying,
Sorry, I just realized that I never replied to this thread.
The solution you suggested works perfectly, thank you.
-
Glad to hear that 🙂
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.