What if you try adding this to your functions.php
function tb(){
wp_enqueue_script('thickbox',null,array('jquery'));
wp_enqueue_style('thickbox.css', "https://wordpress.stackexchange.com/".WPINC.'/js/thickbox/thickbox.css', null, '1.0');
}
add_action('wp_enqueue_scripts','tb');
and keeping your bit of jQuery (not sure what your are needing those php variables for):
jQuery(document).ready(function() {
jQuery("img").parent("a").addClass("thickbox");
});
Related Posts:
- show hide image script after 4 seconds [closed]
- Set default image link target in Gutenberg image block
- Graphing libraries for WordPress [closed]
- 3.5 media.editor: what is the event listener for choosing an image?
- JavaScript and images files are not recognized
- Update an image block style programatically
- How to get the image-URL from Media-Upload in a post?
- Only make custom image size if uploaded via Thickbox and attached to certain page
- Image modification
- Landing Page with HTML CSS JS and Images on wordpress
- Built-in image lazy loading: Does it come with a polyfill for older browsers?
- Images names not inserting in WordPress Database from Dynamic Add / Remove fields
- js alert in add_filter function for image_send_to_editor
- WordPress Javascript displaying an image Question
- Display images from JS?
- Thickbox not displaying just the image, instead showing full page in lightbox
- 3.5.x Theme Customize: Handling Custom Control Requests
- *box for images displayed as a post’s [gallery] [duplicate]
- Script not working in WordPress [duplicate]
- Remove images (files) that were generated when using add_image_size()
- Displaying images from external RSS feeds?
- Why should I use “Organize my uploads into month- and year-based folders” option? (Cons/Pros)
- Which action hook can I use when a featured image has been selected
- Displaying images with relative paths in the editor
- Prevent image upload unless exact size
- Fixing external image urls
- Image resize with image url
- Preview Image Path in Admin Section
- The WordPress Gallery, Grabbing The Link and Images?
- Featured Images on Front Page
- How to upload images from my directory into my wordpress?
- Ability to edit image via WYSIWYG
- Why images/photos after being uploaded to my wordpress site get slightly blurry?
- Featured Image .svg height and width 1px only
- Extend core block attributes in post content
- Images are randomly deleted from server
- Rename image file by post title
- Rename media files generated during upload
- Featured image (responsive) above content is too small after update to WordPress 4.4
- How to show only posts with images?
- Image popup in a lightbox / overlay from the backend 3.5 admin area (plugin)
- Auto resize images after adding a new size
- Upload .doc to blog
- media sideload image and Google Content
- How can I insert an image map into a WordPress blog post?
- Isolating images in uploads not used/recognised by WordPress
- Add width & height attributes to Gutenberg’s image output?
- How to filter the image embed code based on link type
- Include image in excerpt
- images not showing after transfer
- Retain the original name of the image on resize
- WordPress 4.1 header image problem
- force feed readers to pick atom version
- Ways to show multiple, separate galleries per post?
- Stop WordPress from cropping images using url parameters
- Should I not compress my jpeg files before uploading to avoid double compression?
- Generating a certain sized thumbnail on the fly?
- Link listings with image
- Allow users to contribute images to a post
- After Migration, images show up on a preview of the page but not the actual page [closed]
- How to apply image alt descriptions from media library?
- Specify automatically the height and weight of the images
- Image upload error?
- How to crop images in a certain size only for a certain page?
- How to pass on a value as parameter via url to another page
- Image not showing using a custom function and get_post_meta
- Random home page background images with caption text
- Using different size thumbnails on different parts of my site… with functions.php?
- Hover a css icon width other color inside wp_get_attachment_image
- Pictures randomly replaced by blue question mark
- WordPress PHP custom function is causing 500 Internal Server Error Connection Timeout
- Post-processing of the image failed
- Get post thumbnail in specific size
- How to skip the creation of landscape thumbnails for an original portrait image
- Why are my button images blurry on mobile screens?
- Text not wrapping properly around image in WordPress Visual Editor [closed]
- Broken imges after moving wordpress website from localhost to server [closed]
- How to regularly backup and update WordPress website with lot of images?
- Resize images to match CSS
- Featured image appears in header
- Preventing the image-post problem from ahead (edit: without redirects)
- How to put images into theme from server folder (not from media library)
- How can I stop WP Image Editor upscaling from looking so pixellated?
- Select image and display from textfield?
- How to show images uncropped after uploading?
- add_image_size() width not actually working
- Black and White Thumbnail in WordPress Gallery
- (Dynamically) Decrease the actual image size for downloads
- Are image addresses security relevant?
- wordpress images not display [closed]
- Parallax image problem
- While doing a bulk upload the Media Images are showing blank?
- Get content from one WordPress website to another
- How to get WordPress to resize images for srcset?
- How to give path to image in wordpress?
- Edit multiple posts featured image
- Make Jetpack CDN to filter/ignore images based on SRC [closed]
- images map on website not working
- Remove srcset thumbnail attribute for products in the WooCommerce shopping cart
- Images Not Displaying On Page or Media Gallery After Multisite Migration