Try adding this to your theme’s function.php. It worked for me, hope it helps.
// PRETTY PHOTO //
add_action( 'wp_enqueue_scripts', 'lightbox' );
function lightbox() {
global $woocommerce;
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
{
wp_enqueue_script( 'prettyPhoto', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
wp_enqueue_script( 'prettyPhoto-init', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto.init' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
wp_enqueue_style( 'woocommerce_prettyPhoto_css', $woocommerce->plugin_url() . '/assets/css/prettyPhoto.css' );
}
}
Related Posts:
- Set default image link target in Gutenberg image block
- Is there a hook which fires after all thumbnails are generated?
- Remove title attribute from images
- Saving the pre-sanitized filename of an attachment as the Title or Caption
- Alter image output in content
- Wrap all post images inside a div element
- Add “data-” attribute to image links
- How to change image atributes right before an image to be saved?
- How to add custom classes to figure element only if image has caption?
- How to filter the image embed code based on link type
- Add custom text in the media library image meta area
- Generate images to be associated for tag and category?
- I want to Add My Product Image to Admin Order Email in Woocommerece [closed]
- Force default OG:Image – Yoast SEO [closed]
- How to get title of images in post content
- Wrap post images with a link, not figure (image_send_to_editor doesn’t work)
- Generate links on all images in posts – is there a hook?
- How might one programmatically set the link for all images in all posts?
- How to make plugin work in each template in wordpress
- Custom filename when pasting an image from clipboard
- Profile Image displaying on Wrong side of WordPress Navigation Menu
- Default image size not working
- Unyson Framework doesn’t show gallery images
- Regex expression for redirecting image URLs to another folder
- Loose images in uploads folder
- Image auto resize
- Migrate image from my old blog
- the_post_thumbnail() image sizing problem?
- How to stop thumbnail generation from some images and different size thumbnail generate
- Update old Post image metadata to ‘thumbnail’ wp_attached_file
- Multiple amp-image overlays. How to properly do this in wordpress?
- Retrieve images from parent site to child site using current shortcodes
- get current date + 90 days and checking every day
- How to find images in lazyload to set alt attribute?
- Image not shown in the theme as it’s showing in HTML template [closed]
- Imagick vs GD colour issues on image uploads
- Update an image block style programatically
- How to add image and featured image to post by WP REST API
- Why are images created by WP larger than the original uploaded image?
- Broken image links even though links are correct and images exist
- Jetpack’s photon causes local site to try and serve images from WordPress CDN [closed]
- Force minimum image size and aspect ratio when uploading images
- wp_generate_attachment_metadata is creating an empty array
- having issue while uploading An error occured in the upload. Please try again later
- How to stop wordpress always displaying full-res images
- Missing a temporary folder.error when image is uploaded in admin Set temporary Directory – WordPress 5.2.2
- How can I use cached images in an AJAX response?
- Transfer only original images to new site
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Default Image Link Type Setting not Working
- Changing default img html markup but not in admin back-end?
- Force media library editor to overwrite the original filename?
- Fallback for missing srcset images
- Hero image cropped at different dimensions
- Move Image Captions Inside Link ( tag) if Added
- Is it possible to change ‘Link to’ in all images in all articles?
- max_srcset_image_width doesn’t work as intended
- How can I add a “data-pin-nopin” the featured image html?
- Sharing images to social media – issue with aspect ratio
- Hardcoded Images Too Big
- Can’t get images to align with Gutenberg editor
- Retrieve an array of image URLs that belong to a gallery
- I got an issue after i migrated a site
- Add width & height attributes to Gutenberg’s image output?
- update_post_meta attachment_image_alt description for Gutenberg
- Add select input with pre defined classes to insert image screen?
- Help With Custom Image and Text Widget
- Is there a way to change all already uploaded images which are PNG and convert them to JPG?
- Get Time Taken By Each Action Hook in WordPress
- WP fails to upload files to media library, /wp-admin/async-upload.php 403 forbidden
- add media button is not working
- Undefined index: sui_image_caption in [closed]
- add_shortcode to capture URL screenshot not loading correctly
- Contact Form 7 Get Image Function [closed]
- wordpress (woocommerce) add image to media library programmatically python
- How generate 200% image size and save with suffix @2x
- Get ALT attribute from title post (code not work)
- Load external images via proxy
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Add a background image for Custom Post Type archives page
- Convert uploaded GIF to non animated image automatically
- Control Responsive Images
- Is it possible to split Default WP Media directory to multiple Folder/Subdomain?
- Filtering WooCommerce Orders by Category
- Broken Images until Page Refresh
- Scaling images for mobile
- Best place for short bio,image and button [closed]
- How do I fix “Sorry, this file type is not permitted for security reasons”
- Add srcset and sizes to older uploads?
- Searching for any images in media library displays “no media found”
- Bulk edit WP posts to update embeded images with new alt tags
- Resize into square the single product image in woocommerce without cropping [closed]
- an error occurred in the upload. please try again later (Maybe File Permission Issue)
- Change align classes for images
- Locally Developing a wordpress website, cant get images to display?
- Is it possible to put images as url in document [closed]
- How to add an image to a custom url?
- Ho to add “Create Slider” option to default “Add Media” popup?
- Creating ‘required’ fields in the ‘add media’ window
- Is it ok to paste a WordPress Image URL into a post?