• Resolved Anthyx

    (@anthyx)


    Hi,

    I have used your great plugin for quite a long time without problems.

    Recently I have installed the last update. Now the plugin tries to open not justthe local images but also my links to wikipedia images (like this one: https://commons.wikimedia.org/wiki/File:Epicurus_Nuremberg_Chronicle.jp), failing.

    I’d like the plugin to open just the local images, not those I have linked, as it was before the update. Can you help me please?

    Many thanks in advance.

    A.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Anthyx

    (@anthyx)

    Hi again,

    it seems it’s possible to disable Easy FancyBox for certain images using the class=”nolightbox”.

    Problem is that this way I should add this parameter to all the (many) external links of my site.

    Since before the last update this worked quite fine, is something changed? Are there no options for external images?

    Again, many thanks

    Hi Anthyx, before the update the plugin did not discriminate between ‘local’ and ‘remote’ images. Nothing has changed in that respect. I have no idea why a link to https://commons.wikimedia.org/wiki/File:Epicurus_Nuremberg_Chronicle.jpg would NOT have been detected by FancyBox before…

    Your only options are either to add the class=”nolightbox” to every wiki image link OR to remove “.jpg” from the Auto-detect field on Settings > Media under the Images section.

    Or you could add a little script to your theme’s footer.php (before the wp_footer() call!) that adds a “nolightbox” class to all wikimedia links on the fly. Something like:

    
    <script type="text/javascript">
    jQuery(document).on('ready', function(){ jQuery('a[href*="commons.wikimedia.org"]').addClass('nolightbox'); });
    </script>
    
    Thread Starter Anthyx

    (@anthyx)

    Hi RavanaH,

    many thanks for your reply. I have tried to add your script where you said:

    *******

    <?php
    /*
    <div id=”site-generator”>
    <?php do_action( ‘twentyeleven_credits’ ); ?>
    ” title=”<?php esc_attr_e( ‘Semantic Personal Publishing Platform’, ‘twentyeleven’ ); ?>”><?php printf( __( ‘Proudly powered by %s’, ‘twentyeleven’ ), ‘WordPress’ ); ?>
    </div>
    </footer><!– #colophon –>
    </div><!– #page –>
    */ ?>

    <?php
    /**
    * Codice per far aprire i link Easy FancyBox in una nuova finestra
    *
    */
    ?>
    <script type="text/javascript">
    jQuery(document).on(‘ready’, function(){ jQuery(‘a[href*="commons.wikimedia.org"]’).addClass(‘nolightbox’); });
    </script>

    <?php wp_footer(); ?>

    </body>
    </html>

    ******

    Problem is it does not work: I just get a string of text at the bottom of every page.

    it’s probably my fauls, since I don’t know php, could you pls help?

    Can you share a link to your site?

    Thread Starter Anthyx

    (@anthyx)

    Yes, of course.

    The address is:

    http://www.webfoodculture.com

    You’re very kind, thanks!

    A.

    I do not see that script snippet anywhere… Can you put it inside a sidebar (or footer) text widget?

    Thread Starter Anthyx

    (@anthyx)

    Hi RavanaH,

    sorry for the late reply: as per your instructions, I have inserted you script:

    <script type="text/javascript">
    jQuery(document).on(‘ready’, function(){ jQuery(‘a[href*="commons.wikimedia.org"]’).addClass(‘nolightbox’); });
    </script>

    In the footer.php file, before the wp_footer() call.

    As you can see the problem is not solved and the string

    script type=”text/javascript”> jQuery(document).on(‘ready’, function(){ jQuery(‘a[href*=”commons.wikimedia.org”]’).addClass(‘nolightbox’); }); </script>

    appears at the bottom of every page.

    There is probably something I’m doing wrong, please let me know.

    Thanks a lot!

    A.

    What do you use for editing the footer.php file? Make sure it’s a simple text editor, not a rich text editor. All special characters like <, > and ” signs have been transformed to so-called escaped format which results in them being printed out as HTML instead of treated as code by the browser.

    Thread Starter Anthyx

    (@anthyx)

    You’re perfectly right RavanH,

    yes, I use Brackets that should work just fine, fact is that, I don’t know why, as you said, your original code was changed.

    Now it works just fine!

    Many many thanks Rav! Problem solved ;-D

    Don’t know Brackets (use mostly Atom myself) but maybe when copy/pasting the program assumes it should be pasted in HTML escaped format because of some preference setting or pre-selected ‘file format’ option? Anyway, good to hear it’s working now 🙂

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Disable easyfancybox for external images.’ is closed to new replies.