WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Can't get it working on html5 themes (7 posts)

  1. infected
    Member
    Posted 3 years ago #

    Here's something strange: I'm going to design a new theme based on a blank html5 theme. Regardless of which blank theme i use, the plugin doesn't work on index pages.

    I tried it with the toolbox theme for example. A html5 theme developed by Automattic.

    The plugin doesn't work on my index page. The pictures are opened in a new tab. But when viewing the single post (single.php) it is working. I have no idea why this is happening. I experience the same problem in all other html5 blank themes i tested.

    I also tried the plugin auto-thickbox, which worked out of the box on both index & single pages.

    Maybe someone of you can help me?

    URL for testing

  2. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    I can explain that... The auto-attaching jQuery is looking for divs with class "post" on index pages to limit the gallery mode to each post instead of linking all images from different posts together. But in your strict HTML5 code you are using <article> instead of HTML4 <div>.

    The script does not recognize that, so the image links are being ignored.

    For the next release, this feature -- not linking images from different posts on index pages together in one gallery -- is going to be (1) adapted to support pure HTML5 and (2) optional.

    Up till then, you could try editing easy-fancybox.php: on line 977 you will see jQuery(\'div.post\'); at the end. Change that to jQuery(\'article\');

    Hope that helps :)

  3. infected
    Member
    Posted 3 years ago #

    Thanks for your reply, RavanH!

    First: Yes, changing the easy-fancybox.php made it working on both templates. Thank you!

    But i still don't understand why because the outputted html code on single.php is nearly identical to the code in index.php. So, <article> is used in both templates. I didn't understand the differences between these both and why it's working on single view.

  4. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, but the jQuery code for attaching FancyBox is different on single page/post view... There is no checking for div.post/hentry or anything going on there to prevent unnecessary javascript time/resources consumption.

  5. infected
    Member
    Posted 3 years ago #

    Aaah okay. Thanks for your description. I think i get it now :) Thank you for your support!

  6. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    HTML5 should be supported in the new 1.3.4.6 but please let me know if you run in to problems :)

  7. infected
    Member
    Posted 3 years ago #

    Everything seems to work fine at the moment ;) Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic