You should add !important
to your styles in order to override it. Better way to do this is to copy the .img-responsive
styles from the Bootstrap CSS file and apply these styles to your desired HTML element instead of adding a class using PHP.
img.attachment-large {
display: block;
max-width: 100%;
height: auto;
}
Or target the element by the parent element if the class is not constant.
OR use this filter.
function my_image_class_filter( $classes ) {
return $classes.' attachment-large';
}
add_filter( 'get_image_tag_class', 'my_image_class_filter' );`
Related Posts:
- Making WordPress Gallery (.gallery-item) Responsive?
- How to Make WordPress Default gallery responsive on mobile?
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- How do I delete all UNUSED images from my uploads directory?
- How to extend the gallery block in Gutenberg?
- Prevent WordPress from adding image’ title automatically
- Overide Gallery Default Link to Settings
- get_post_gallery with Gutenberg
- How to have different captions for same image, for galleries?
- How to reference a theme image in a stylesheet?
- get_post_gallery_images returns thumbs . I want full size
- WP 3.5 and Galleries – how to count images?
- Navigate with keyboard in Gallery shortcode
- Cropped featured image replaces original image in gallery
- get images from post and make a zip
- Bulk edit wordpress images alt and title attributes
- Change the output for [gallery] shortcode
- How do you modify the HTML output of a Gallery item (using the gallery shortcode)?
- How to include externally hosted images into a gallery block
- Adding HTML within an image title attribute
- Excludes posts that don’t have attachments in the_content()
- Width 100%: Aspect ratio of image
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- Setting up a gallery with images and a zip download
- How to remove title attribute from gallery links and images
- How can I make all gallery images to open in a new window?
- Add CSS class to every image
- The WordPress Gallery, Grabbing The Link and Images?
- Displaying a featured image (only img url) as the img src?
- How to force WordPress to add new images at the beginning of the gallery?
- How to link Gutenberg Gallery images To Media file automatically?
- Responsive background images added inline
- get attributes/part of the gallery shortcode
- Different captions for the same image in multiple galleries. Edit Image in Gallery locally
- @wordpress/create-block image url in css
- Editing built in Gallery shortcode to filter by categories
- Gallery images stored elsewhere (preferably Google Drive)
- WordPress gallery previous/next buttons showing all media library images
- Any way to “combine” galleries or show multiple galleries as one?
- Best option for photo/gallery handling?
- Gallery post images on homepage?
- How to create a simple slideshow out of a post image gallery?
- How to change the target size of images clicked on in WordPress standard gallery
- Get meta data from image
- Exclude featured image from gallery in wp-admin
- How can I upload an image for background use using the Theme Editor in WordPress?
- WooCommerce-like featured gallery
- Pull Random Attachments With Pagination
- Extracting gallery images in WordPress 3.5 on index.php
- wordpress get gallery images title
- How to use photo in multiple posts?
- Exclude images from “inserted into post” when trying to get attachments
- Is this post using WordPress Gallery?
- Turn off image captions in gallery view?
- Customizing the attachement page to show rest of all images in a gallery from post
- Unyson Framework doesn’t show gallery images
- Multiple amp-image overlays. How to properly do this in wordpress?
- Image not shown in the theme as it’s showing in HTML template [closed]
- Retrieve an array of image URLs that belong to a gallery
- Ho to add “Create Slider” option to default “Add Media” popup?
- How to handle a background-size: cover image in WordPress?
- How to make a gallery with dynamic images from URLs?
- Background-image not showing? [closed]
- t5-fresh-editor-stylesheets.php breaks image placement in WP Beta 3 editor
- How can I display an image description, from an image gallery?
- Removing featured image from gallery?
- Creating a post image to show in a gallery
- Don’t show images inserted into content
- Gallery with thumbnail carousel
- Ways to show multiple, separate galleries per post?
- Native gallery sorting is ignored
- How do I get my main image to stretch the full length of the screen?
- Using Jetpack carousel w/o creating a gallery [closed]
- How to get the Gallery form/section just like in Gutenberg block?
- Media gallery images url instead of ID on WP API Response
- Load Gallery Images with Title on Homepage BX Slider
- Get all image IDs from the Media Library
- Re-ordering images in existing post in wordpress 3.6.1
- Autosort uploads in galleries by filename
- How to display original unmodified thumbnail
- One picture belonging different galleries?
- Allow users to contribute images to a post
- How to upload and style svg logo?
- How would you add sequentially numbered labels to images in posts?
- css to fit image by HEIGHT
- How to implement CSS-defined images from bootstrap site in wordpress theme
- a: hover issue with image issues [closed]
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- Moving an image to the side [closed]
- How to remove the images from “Uploaded to this post”?
- limit number of images shown from gallery
- How to automatically populate a gallery with images attached to posts of one category?
- What is the plugin to import image from URL?
- Pagination between images (active/inactive)
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- photo gallery implementation like tmz
- How do I display the featured image from an image gallery using a reference in code? (example within)
- Image Captions Have a 10px Extra Margin, And It’s Not CSS? [duplicate]
- How to enlarge thumbnail on mouseover?
- attach several images to post + gallery