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?
- How to have different captions for same image, for galleries?
- get_post_gallery_images returns thumbs . I want full size
- WP 3.5 and Galleries – how to count images?
- Cropped featured image replaces original image in gallery
- Change the output for [gallery] shortcode
- Adding HTML within an image title attribute
- Excludes posts that don’t have attachments in the_content()
- Width 100%: Aspect ratio of image
- 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?
- The WordPress Gallery, Grabbing The Link and Images?
- How to force WordPress to add new images at the beginning of the gallery?
- Different captions for the same image in multiple galleries. Edit Image in Gallery locally
- @wordpress/create-block image url in css
- 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
- Extracting gallery images in WordPress 3.5 on index.php
- wordpress get gallery images title
- How to use photo in multiple posts?
- Customizing the attachement page to show rest of all images in a gallery from post
- 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?
- Creating a post image to show in a gallery
- Don’t show images inserted into content
- 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]
- Load Gallery Images with Title on Homepage BX Slider
- 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?
- How would you add sequentially numbered labels to images in posts?
- a: hover issue with image issues [closed]
- How to remove the images from “Uploaded to this post”?
- limit number of images shown from gallery
- What is the plugin to import image from URL?
- Pagination between images (active/inactive)
- photo gallery implementation like tmz
- Image Captions Have a 10px Extra Margin, And It’s Not CSS? [duplicate]
- How to enlarge thumbnail on mouseover?
- How to remove image size inline style in article and include caption
- get_post_gallery with Gutenberg
- Is there a layout to place 2 same sized images in two columns on the WordPress page?
- Allow users to upload and display multiple photos
- How to change Gallery image url in product page ? In function.php?
- How do you obtain a list of all image file names on a wordpress website for replacement?
- Implementing a modal(lightbox) for all images in all post-gallery posts
- Images getting smashed
- How to re-arrange images in default WP Gallery more than one image at once?
- Convert multiple image blocks to gallery block in Gutenberg?
- Images 404 after wp migration to a subdomain
- Change header image size
- Exclude first image from a Woocommerce image gallery
- Adding custom html/css/images to Theme
- How can we achieve this image css style?
- Remove image border in twentyeleven theme [closed]
- How to display posts with images in fullscreen slider
- Put image onto header
- Are WP images responsive by default?
- Gallery Images could not be shown
- all images of past post messed up after changing theme
- Gallery with shortcode not showing
- Show WordPress Image Title Under Custom Portfolio Image
- Replacing an Image gallery
- attachment.php & flexslider—linking thumbnail to specific image
- Thumbnail gallery by date and taxonomy
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Breadcrumbs for Single Image page
- Display ajax preloader for large images within posts
- Slider do not add alt attribute. Cant get alt attribute from a media library!
- Is there a good way to use CMS images with CSS
- Paginate Gallery [closed]
- change with CSS the color of an svg background image set with “background-image: url()”
- Adding different classes to different images depending on size for fine control of image layout in posts
- Stop underlining image links
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- Why is inline CSS added to images automatically? [closed]
- Create decorative image border with CSS? [closed]
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- WordPress update leads to 404 error on admin page and signup. CSS mishap with all plugin related functions
- I am having trouble displaying an image at the top of a widget area [closed]
- Is there a way to add background-image to theme.json?
- Images uploaded in customized gallery do not link to media