WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Shows double images in navigation (12 posts)

  1. myrok24
    Member
    Posted 2 years ago #

    Hi, when i click on a image, from a set of two in total, the fancybox opens just fine.
    But when i navigate in the box, it shows duplicate images, so four in total. I checked the library and there are no duplicates there.

    Im using fancybox in a wordpress them called "Cudazi Mono".

    Anyone familiair with this strange problem?

    thnx!

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    got a link?

  3. myrok24
    Member
    Posted 2 years ago #

  4. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    You have the thumbnail images wrapped in double anchor tags:

    <a href='http://www.popvanstof.nl/tijdelijk/wp-content/uploads/2011/09/gijsdetail.jpg'>
    <a href='http://www.popvanstof.nl/tijdelijk/wp-content/uploads/2011/09/gijsdetail.jpg' title='gijsdetail'>
    <img width="642" height="426" src="http://www.popvanstof.nl/tijdelijk/wp-content/uploads/2011/09/gijsdetail-642x426.jpg" class="attachment-grid_8" alt="gijsdetail" title="gijsdetail" />
    </a>
    </a>

    (notice the double <a href=... at the start and double </a></a> at the end)

    It's some sort of slides function in your theme that automatically creates these links? If you can change the above example (same goes for the second one) to the following, FancyBox will no longer show double images:

    <a href='http://www.popvanstof.nl/tijdelijk/wp-content/uploads/2011/09/gijsdetail.jpg' title='gijsdetail'>
    <img width="642" height="426" src="http://www.popvanstof.nl/tijdelijk/wp-content/uploads/2011/09/gijsdetail-642x426.jpg" class="attachment-grid_8" alt="gijsdetail" title="gijsdetail" />
    </a>
  5. myrok24
    Member
    Posted 2 years ago #

    hmm strange.. yeah if it isn't a fancybox code, then i must seek into the theme ccode i'm afraid.

    Thnx for finding the problem's source anyway.

  6. rmj.86
    Member
    Posted 2 years ago #

    Hi myrok24

    I'm having the same issue with the same theme as you've used, did you resolve the problem? If so can you explain how?

    Thanks

    wwww.beckyjones.co.uk

  7. myrok24
    Member
    Posted 2 years ago #

    @ rmj.857

    I'm not 100% certain if this is what i did, but it was solved by a simple setting in the "media settings" --> fancybox part.

    To be more specific: Under "Links", set the "Exclude" dropdown to --> "Empty (hidden) links" instead of the default "none" setting.

    Let me know if it worked out :)

  8. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    I've downloaded the Mono theme to take a look and as far as I can tell it's in the function cudazi_attachment_gallery. You can find that in the file /mono/libraries/attahment-gallery.php

    On line 55 you see

    $output .= "<div class='post-thumbnail'><a href='" . $post_thumbnail_src[0] . "'>";

    Change it to $output .= "<div class='post-thumbnail'>"; and on line 57 you see

    $output .= "</a></div>";

    and change that to $output .= "</div>";

  9. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    myrok24, that's brilliant! I did not even expect that option in my own plugin to do the job in this case but you are right, that should work :)

  10. myrok24
    Member
    Posted 2 years ago #

    Haha.. You're welcome ;)

  11. rmj.86
    Member
    Posted 2 years ago #

    myrok24, I can't thank you enough, it worked brilliantly and saved me hours of pulling my hair out

    Thanks again :)

  12. afnikitin
    Member
    Posted 2 years ago #

    Wow, I faced with the same problem and I thought there would be kind of tough solution for it. But this found way is exactly what I needed. Thanks to RavanH and myrok24!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic