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
- WordPress crop tool greyed out
- Limit image resolution on upload
- get_the_post_thumbnail_url with an unregistered size
- How to crop image from image src in a specific size
- Resizing only featured images while uploading
- Adding upload button in metabox
- How can I attach images to a post from the media library?
- How can I serve different images depending on screen size with wordpress
- Setting up a gallery with images and a zip download
- When inserting images into posts auto add a wrapping div
- how to base64 encode images in wordpress template
- get_children – wp_get_attachment_image
- Failed to invoke other hook from the init hook
- Generate fixed image sizes for different pages, eliminate sizes during upload
- Setup A Default Featured Image
- Find posts without featured image? [duplicate]
- How do I add a featured image to a single post page?
- Custom image size not regenerating when image editted
- How can I autopopulate titles in the media library?
- Is it possible to remove this action? (as it’s added just before it’s called)
- Image still linked as attachment to page even though it has been deleted
- Disable wordpress image sizes generation
- Issue to get wp_get_attachment_image with cmb2
- Best option for photo/gallery handling?
- Frontend Post – Allow Only Image File Upload
- Plupload resize for worpdress
- File format of post image attachment
- How to display a different image size for mobile
- SEO images in Nextgen Galleries
- Remove Size images without use
- Woocommerce featured image of page – not product
- Can’t seem to attach uploaded image to post and set it as thumbnail
- Add an attribute to attachments
- Include caption underneath post images
- How to prevent WordPress scaling large images down
- wp_customize_image_control deprecated add_tab alternative
- How to translate get_intermediate_image_sizes?
- Change media URL (images)
- Why does WordPress convert my jpg’s to png?
- Autosort uploads in galleries by filename
- How to display original unmodified thumbnail
- One picture belonging different galleries?
- How to display image in mail header using wp_mail()
- Redirect Image Url to a page via htaccess
- How does wordpress name resized image copies?
- Media Editor uppercase extensions to lowercase
- Creating a plugin that will display text on every page
- Web App mode leaves users stranded when following image links when using WPTouch with W3 Total Cache [closed]
- Build a must-use plugin that tracks when other plugins are activated or deactivated
- How to get rid of undefined variable in previous post image
- My authors need to be able to preview their upload images and manipulate and scale
- Issue with LazyLoad, sometimes my pictures aren’t showing
- Why does WordPress list all image sizes in srcset even if they’re larger?
- Custom Image Widget
- Displaying all the images from all of my articles
- Register an embed handler for self hosted images
- Dashboard Create Gallery missing
- Get image thumbnail size urls in media library
- WordPress is showing blank lines instead of images
- Why is my site still showing insecure icon even if I have SSL certificate?
- Change header image size
- How to disable post-thumbnail from generation?
- wordpress plugin translation not working
- js alert in add_filter function for image_send_to_editor
- Add image to post
- all images of past post messed up after changing theme
- Where is this folder [closed]
- Different image heights for different resolutions without distortion
- Get the name of an image [duplicate]
- Lots of attachments is causing slow load
- change output location of plugin function using a custom hook
- Image editor not working correctly
- Making a thumbnail if there exist a link with. jpg or .png extension in WordPress
- Aviary + WordPress Media
- Issues with the excerpt (wordcount/HTML/images)
- Adding social share buttons for individual images on a web page
- How to get the attribues (alt and title) of an image import with ACF [closed]
- How can I use an image from an external source without uploading it to the media library
- Admin Notice is only localized when displaying the “Plugins” Backend Page