Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add img_class argument for get_timber_picture_responsive() #84

Merged
merged 5 commits into from
Aug 27, 2024

Conversation

gchtr
Copy link
Member

@gchtr gchtr commented Aug 27, 2024

Ticket:

This pull request adds an img_class argument for the get_timber_image_responsive() function. It will add a CSS class for the fallback <img>.

PHP

<picture>
    <?php echo get_timber_picture_responsive( get_post_thumbnail_id(), 'custom-6', [
        'img_class' => 'the-class',
    ] ); ?>
</picture>

Twig

<picture>
    {{ post.thumbnail|get_timber_picture_responsive('custom-6', {
        img_class: 'the-class',
    }) }}
</picture>

@gchtr gchtr changed the title feat: Add img_class attribute for get_timber_picture_responsive() feat: Add img_class argument for get_timber_picture_responsive() Aug 27, 2024
@gchtr gchtr merged commit efcf332 into 2.x Aug 27, 2024
20 checks passed
@gchtr gchtr deleted the 2.x-support-css-class-in-jpg-fallback branch August 27, 2024 12:59
This was referenced Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant