• Resolved Frank.Prendergast

    (@frankprendergast)


    I have Jetpack Tiled Galleries enabled, and the appearance of the gallery looks great, and the thumbnail images are being served by photon, but I would like to open the images when clicked in a lightbox (using the link to file option) and I am finding that the images open up from my own domain – not served by Photon.

    Is what I am trying to achieve possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’m afraid Jetpack doesn’t offer that option; when choosing the “Media File” option, Jetpack relies on WordPress Core to get that Media File URL.

    You could, however, use a core WordPress filter to apply Photon to all Media File URLs on your site, like so:

    /**
     * Use Photon for all image attachment URLs.
     *
     * @param string $url Original attachment URL.
     */
    function jeherve_photon_attachments( $url ) {
    	return apply_filters( 'jetpack_photon_url', esc_url( $url ) );
    }
    add_filter( 'wp_get_attachment_url', 'jeherve_photon_attachments' );

    You can paste this code in your theme’s functions.php file, or in a functionality plugin.

    Thread Starter Frank.Prendergast

    (@frankprendergast)

    Thanks for your speedy reply – I will try your suggestion…

    Thread Starter Frank.Prendergast

    (@frankprendergast)

    This worked a treat, thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tiled Galleries / Photon – link to file?’ is closed to new replies.