Tutorial for WordPress #42
Replies: 4 comments 2 replies
-
Hi, Simply replace jQuery(function( $ ){
$(YOUR_SELECTOR).fancybox({
// Your options
});
}); with Fancybox.bind(YOUR_SELECTOR, {
// Your options
}); |
Beta Was this translation helpful? Give feedback.
-
Thank you @fancyapps ! Can something similar to this work?
|
Beta Was this translation helpful? Give feedback.
-
It is still not working for me. Here is a walk through of what I wrote in a note that I am hoping to add to the tutorial. Fancybox Download the zip file and unzip. in the dist folder: Add an init js file to the fancybox folder. I called mine fancybox-init.js.
Move the fancybox folder into the root of the child theme. Enqueue the files with the following code inside the child theme functions.php file or a code plugin.
Ps the readme here in the repo and in the download still links to version 3. |
Beta Was this translation helpful? Give feedback.
-
Going to: https://github.com/fancyapps I see this text: ui Please update the descriptions to reflect what each are. Adding in the version number to each. I have retested and also done some more research. The result can be seen here: I have yet to be able to get Fancybox v4 to work. I believe I might be mixing up the files that I am to use. It would be nice to get this cleared up. To have a clear difference between Fancybox v3 and the Fancybox v4 repos and the code each is to use. When I get this working then we will have a nice tutorial for using Fancybox v4. Btw the main reason why I am updating the tutorial is that I am updating the web site with a new design and using Gutenberg. I am redoing many of the existing tutorials and adding these to the new site I am developing. |
Beta Was this translation helpful? Give feedback.
-
Hi
I am renewing my "Adding a lightbox to WordPress without using a plugin" and further down the page I have earlier mentioned Fancybox 3 which it seems It worked back when I wrote the tutorial.
https://www.easywebdesigntutorials.com/adding-a-lightbox-to-wordpress-without-using-a-plugin/
Here are the steps mentioned in the tutorial:
The process is very similar to colorbox and Magnific.
Add the following js to the init file:
The above is the bare bones code to get it to work.
As Fancybox has switched to fancyapps4.
I copied the code from https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js into a jquery.fancybox.min.js
and
copied the code from https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css into a jquery.fancybox.css file.
and
added a jquery.fancybox-init.js.
It looks like there is something I am not doing right.
Can you help me get the missing pieces in place? I will then add Fancyapps 4 lightbox to my updated tutorial.
Beta Was this translation helpful? Give feedback.
All reactions