Your best bet here would be to use jQuery to grab any link that links to an image and tell it to use fanceybox.
jQuery(document).ready(function($){
$('a[href$="jpg"], a[href$="png"], a[href$="jpeg"]').fancybox();
});
If you want this to work just for your post content areas use this:
$('.post-content a[href$="jpg"], .post-content a[href$="png"], .post-content a[href$="jpeg"]').fancybox();
You will need to replace .post-content with whatever HTML parent element wraps the content area.
Related Posts:
- Filter to remove image dimension attributes?
- Change WordPress image URLs via filter
- Always use for post images
- Change html structure of all img tags in WordPress
- Default Image Link Removal
- Remove title attribute from images
- hook into completed image upload filter
- Filter Media Library by author or post_parent
- Preview Image Path in Admin Section
- How to display a shortcode caption somewhere other than the_content
- Alter image output in content
- How can I remove the image attachment ALT field?
- add data-attribute to all images inside the_content()
- Filter to modify post_title after image upload?
- Change html structure of all img tags in WordPress
- Disable wordpress image sizes generation
- Extend core block attributes in post content
- What’s the proper way to use the get_image_tag filter?
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- How to get image ID to use inside wp_read_image_metadata()?
- Is there any action/filter hook to use when an image gets edited in the editor?
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- How to add custom classes to figure element only if image has caption?
- Change align classes for images
- How to filter the image embed code based on link type
- Add custom text in the media library image meta area
- WP 5.3 Removing Default WordPress Image Sizes
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Remove Image Sizes in Media Settings Page
- How can I use wp_save_image_editor_file filter?
- How to stop WordPress from completely overriding my tags in my templates?
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Prevent WP from wrapping html in caption shortcode after ‘image_send_editor’ filter is applied
- How can I change the to for lazyload wp smilies
- How to display a warning when an uploaded image is too small?
- How to change an image source when rendering on frontend?
- How to change Gallery image url in product page ? In function.php?
- How to get title of images in post content
- How to generate alt attributes with php / filters?
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?
- js alert in add_filter function for image_send_to_editor
- Dinamically modifying attributes of images on posts
- How to attach post ID to image links in WordPress tinymce editor
- image_send_to_editor filter – Unwanted paragraphs and line breaks
- How might one programmatically set the link for all images in all posts?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- Surround uploaded image link with div
- Removing image dimensions from `the_content`
- Rename uploads filenames to POST-ID on upload
- I tried to move the featured image below the paragraphs but now it is displaying twice
- How to add a link to media file for every image inserted in content?
- Replace image with its alt text?
- Get field added via attachment_fields_to_edit filter in Gutenberg
- Neither intermediate_image_sizes_advanced or intermediate_image_sizes filter is firing
- ‘Add Media’ to post – filter images
- ‘apply_filters’ is breaking some shortcodes/HTML but not all
- What is a good alternative to using $content_width for image optimization?
- Can I attach image to post without adding it to post?
- How to avoid WordPress stripping EXIF metadata when resizing images?
- Navigate with keyboard in Gallery shortcode
- Alter media caption/description conflict in WordPress?
- Loop through child images of a parent for a Nivo Slider
- Rename attachments during upload
- Limit author image size
- Remove the http protocol from images
- Display one random image, but only if landscape
- How to change image url?
- How to order images in a post in WordPress 3.3?
- Override img class in gallery
- Change image url size in post editor (when cliking on image)
- image uploaded cant be shown
- I want to use the GD image editor for just one function then switch back to ImageMagick
- Don’t show images inserted into content
- Replace post/page titles with an image in WordPress
- What happened to the media manger?
- Howto use WP built in Thickbox for images?
- Re-ordering images in existing post in wordpress 3.6.1
- Change Image folder Locations
- “HTTP Error” or Network Error (tcp_error) when uploading image
- Hide Featured Image box – isn’t working?
- Optimising uploads folder then re-uploading?
- Using a .pdf file as a page in wordpress
- How to remove “Image Information” and “post date/author” from a media page?
- Add images to my theme with html
- Initializing the cropper for image uploads
- How to bulk change media item’s link?
- attachment_fields_to_save first parameter is null
- I cannot upload images to post or the media library in wordpress
- What is the Best way to post each pictures uploaded separately and automatically?
- Show WordPress Image Title Under Custom Portfolio Image
- Title image is missing ( but is not the WP 3.5 issue )
- Resizing to bigger proportions as original not working
- Admin bar stats widget plugin image broken
- Load Webp Version of Image if it exists
- Convert User’s Avatar/Gravatar to a jpg or png on the Fly
- Placing a background image with text over it
- Is there a way to add background-image to theme.json?
- After importing using wordpress importer, posts in duotone theme do not pick up background colours from image
- I can’t insert more than one image when creating a custom email
- How do I set attributes for all images in a site