You can use the filter get_image_tag_class
which exists exactly to do what you want:
add_filter('get_image_tag_class','wpse302130_add_image_class');
function wpse302130_add_image_class ($class){
$class .= ' img-fluid';
return $class;
}
Related Posts:
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- Overwrite Parent Theme add_image_size in Child Theme
- Control the srcset much more (not all sizes in it each time)
- Way to store featured image width and height in two separate variables?
- Add image size if page template
- Display random categories on the front page (Finding and Editing Theme Functions)
- remove links from images using functions.php
- How to get woocommerce inventory status [closed]
- Removing default image size list in Media Box
- How to add classes to images based on their categories?
- How to create thumbnails for PDF uploads?
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Organize functions.php
- How to override functions.php in child theme?
- Is it possible to maintain image aspect ratio when scaling images?
- Generating Responsive Background Image Sizes in PHP
- Add inline css to theme
- How to add a rel attribute to images that contains their categories?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Display height and width properties with the_post_thumbnail() or related function
- Dequeue script in template isn’t working
- Custom image size in Media Dropdown
- Add external js file to footer with id
- Changing itemprop from logo to image on custom logo?
- Removing the first image in content
- Function to auto-set a featured image that is already in use
- Actions according to image type and size
- Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
- How to call custom function from functions.php in site-wide template files?
- How to use thumbnails in gallery?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- How can you limit srcset on a single type of page?
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Overwriting Parent Theme’s Image Sizes
- Override a theme function in a child theme?
- Pulling Twitter RSS feed not working as expected (fatal error)
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- Use register_setting() in a loop
- Add dynamic links in WordPress custom theme
- how can I edit flexslider in woocommerce. [Urgent]
- enqueue styles for only mobile wp
- Jquery implementation not working on page reload
- Usage of theme name in functions
- media resize/crop possibilities?
- Redirect to another page using contact form 7? [closed]
- ACF not showing
- Check if the image size is available and if not use ‘full’ image size
- Remove Custuomize Sections
- Can we create our own theme’s function.php?
- Limit dimensions of “Full” size images
- Define PHP variable from a seperate API if statement
- get_pages() Returns Only One Item
- Does size of a theme’s functions.php file matter?
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- PHP 7.1 | Warning: A non-numeric value encountered in
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- How to Add Shortcode to html img code?
- Getting the teaser text without overriding global variables
- Combine two active_callbacks into one on theme customizer
- How to add a new image size and apply it to posts only?
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- What is the correct way to include my new functions and scripts in WordPress?
- wp_nav_menu work in functions.php but not in the theme
- Problem in using Customizer
- Custom Image Size in Insert Media
- get_image_tag() html output : empty src attribute
- How to make excerpt image be full size instead of thumbnail?
- Need To Resize Images Exactly Without Losing Image Details
- how can I change all wordpress media file url to custom cdn url?
- How to fix Function create_function() is deprecated in / themes
- WordPress wp_dequeue_script remove all other scripts
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- wp_title() return random number
- blank page with wp_get_attachment
- How to offset main query without affecting other queries and backend
- How to wrap image tag into div for post only?
- Featured image on archive page based on post type
- How to retrieve image IDs from shortcode content?
- HowTo: Add wrapper to columns shortcode?
- How to create admin ajax function for my contact form
- Class::$template_dir_path=get_template_directory();
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Different body image backgrounds on different pages, posts and categories
- wordpress not calling peliegro functions.php?
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- Update add_image_size
- Language switcher for subdomains
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Load a Child Theme’s style.css just before the closing tag
- Full size image option removing problem
- Add the title of a widget as an ID – for anchor links
- Add custom css to theme
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- How to get postId from the argument $block when register_block_type()?
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?