• After adding gallery on english foobox is not recognized.
    Image is just opened in full screen without foobox opetions

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi nesaict,

    I was experiencing exactly the same issue on my site (foobox opens correctly on pages in my default site language but translated pages just lead to the full-size image).

    After some digging in the html of the foogallery I noticed that on translated pages class specifier “fbx-link” was missing for the thumbnail links. With help from this translatepress documentation page I managed to fix this issue with the following PHP snippet:

    // ### FIX FOOBOX NOT LOADING ON TRANSLATED PAGES ###
    
    add_filter( 'trp_no_translate_selectors', 'translatepress_preserve_foobox_links', 10, 2);
    
    function translatepress_preserve_foobox_links( $selectors_array, $language ) {
        $selectors_array[] = 'a.fg-thumb';
        return $selectors_array;
    }

    (Place this code in your theme’s functions.php or create a plugin for it)

    Now foobox opens correctly on both my default and translated pages as I wanted. Hope it works for you too and anyone else experiencing this problem.

    @bradvin – are you able to review this as something we may want to add directly to FooBox?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Foo box not working with translatepress’ is closed to new replies.