Try get_image_tag filter:
add_filter('get_image_tag', function($html, $id, $alt, $title, $align, $size)
{
return $html . '<div>some piece of code here</div>';
}, 10, 6);
References:
Related Posts:
- Show modified time if post is actually modified
- AJAX handler throws 400 (Bad request) – why?
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- Most elegant way to enqueue scripts in function.php with foreach loop
- WordPress – thumbnail image from youtube (function and loop)
- Adding WooCommerce to a Custom Theme – not working [closed]
- Function to show only first instance of shortcode
- Automatically insert php function into post $the_content
- Creating loop within functions.php
- Display WooCommerce subscriptions for user [closed]
- How to use max and min values of custom fields
- Custom Shortcode, functions PHP WP_Query loop
- Filtering posts by category name based on page’s slug
- 2 Loops, Only Displaying 1 Loop in Both Loops
- Having a Function Inside of the Loop
- Getting different functions data while using while loop in wordpress
- Create a new query in function.php to filter blog posts
- Limit length of first excerpt in the loop
- Default Custom Field Value Automatically Update
- Multiple Loops Meta Data
- Why doesn’t is_page(id) work in functions.php?
- The Loop not looping?
- While loop with an exception after a count is reached
- How do I pull excerpts from pages?
- Output loop to function return?
- issue with if/elseif in_array inside foreach loop display only one post
- Genesis Framework: How to exclude a specific author from archive custom loop
- Problem with calling custom function in a foreach loop
- Get term slug by term id and then explode it
- Using functions.php to include code that’s processed inline
- Breaking up multiple words and inserting an image after first word
- Simplest Way to Build Custom Archives Page?
- Woocommerce Variable Product Dropdown for Custom Shop Template
- the_date() and the_time() functions display actual date an time instead of published date and time
- How set a while with a function
- Pass post ID from archive template to functions file
- Prevent function from triggering on current page
- How to use `foreach()` in ajax call
- Code executes outside of Loop while same code gives ‘Uninitialized string offset’ notice inside a while loop
- Only seems to be displaying one child when there are supposed to be multiple
- Integrate WP Tiles into existing loop (index.php) and theme
- Check if excerpt is empty at loop-portfolio
- Function to get the name in database table from the comma separated string
- Way of getting queried loop before the query with a filter hook?
- Post variables not displaying correctly in custom function
- Why don’t some template tags work when querying information on single.php?
- how to handle multiple forloop?
- Parse error: syntax error, unexpected ‘endforeach’ (T_ENDFOREACH) in [closed]
- How do grab the main loop, with conditions, and output via shortcodes
- Creating mixture of shortcodes to use in the visual/text editor
- Get full slug for a WordPress Post
- Update post meta with wp cron
- How to change the markup WordPress inserts for post images
- wp_mail not running inside Cron
- Remove product description from product archive page
- Logging in redirects to correct page but shows logged out content until forced refresh
- How do you output custom code between posts in the loop?
- Custom logo sizes for multiple logos
- Loop (iterate) through Multi-Site sub-sites (blogs)?
- Proper way of using functions in action hook?
- Custom function for specific user role
- Add custom image size not working
- Not sure if enqueuing js scripts properly
- Shortcode inserts paragraphs before and after executing shortcode
- Get_template_part inside a folder
- How to remove style attribute in WordPress RSS output?
- How to stop wordpress from injecting hard-coded style into image attachments with captions
- Two functions with different arguments and add_actions, but identical code
- How to fix get_the_category function returning incorrect slug?
- How to edit the Tags within the image file URLs?
- Disabling visual editor on a specific post
- Disable wp_is_mobile()
- The_excerpt() doesn’t parse – how to change that?
- Testing for a shortcode using a function. 404 page throwing PHP Notice
- How to get post revisions in my custom rest API? [closed]
- Strip div From Excerpt
- Image Crop Not Working
- Function to check if custom page is used by page?
- How to Display WooCommerce Product Price in WooCommerce Archive
- Bizarre Child Menu Issue on WP Site
- get variables data from functions.php to template wordpress (without global variables)
- how to increase connection time
- Shortcode to insert default text and change one word throughout it?
- Its my first time trying to create a website , I got an error Please help
- Drop down list code for sidebar
- Shortcode Initialization in a Custom Theme
- Hide disclaimer from summary excerpts
- Load scripts into an AJAX div
- restrict uploaded image size and fixed image display size
- Restricted images only for logged user. (hidden url)
- Open image size links in a page instead of direct image link
- Override parent theme function that is not hooked or in the functions.php file
- Syling Custom Fields echo’s from from functions.php
- Function to get thumbnail img source
- WP Custom Comment Callback Not Responding
- Do something when user creates post (that’s pending)
- How I can show short content with short tag
- Load script only on selected Pages
- Using input_attrs() Multiple Times Within One Customizer Control
- Convert Image to Webp on upload without plugin