• Hello WordPress,

    I have question How Using Photon just for Internal Image, The problem is most of my image hosted in external site like blogspot, etc.

    But when i am using photon the external image is not load, so i think to use photon just for internal image not for all image.

    And the question is what must i do to Using Photon just for Internal Image.

    Thanks

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

    (@jeherve)

    Jetpack Mechanic ??

    You can use the jetpack_photon_skip_for_url filter to exclude specific URLs from Photon. In your case, you can use that filter to exclude all URLs that are not from your site. You can check the documentation for a working example:
    https://developer.jetpack.com/hooks/jetpack_photon_skip_for_url/

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

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Text widgets don’t use Photon by default, but you can force them to use Photon with the code in this post:
    https://jeremy.hu/jetpack-photon-text-widgets/

    One Again Thank You Jeremy ??

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    That won’t be possible without making changes to the Recent Posts Widget Extended plugin.

    I would recommend that you contact the plugin authors and ask them to consider supporting Photon for the widget images displayed here.

    You can open a new issue on their GitHub repository here.

    To support Photon, they could use the jetpack_photon_url filter in their plugin. You can send them this example so they can find out more:

    /**
     * Add Photon support to any image.
     * The jetpack_photon_url filter will allow Photon to serve the images if Jetpack's Photon module is on.
     *
     * The filter allows you to pass an image URL, and some optional parameters.
     *
     * @param string $image_url Any image URL can be used.
     * @param array|string $args Optional options to manipulate images.
     *     @see https://developer.wordpress.com/docs/photon/api/
     * @param string $scheme Optional scheme in which to return image.
     *     Accepts <code>http</code>, <code>https</code>, and <code>network_path</code> (no protocol).
     */
    $image_url = 'https://mysite.com/img/logo.png';
    $args = array(
    	'filter' => 'grayscale',
    	'resize' => '600,200',
    );
    
    echo apply_filters(
    	'jetpack_photon_url',
    	esc_url( $image_url ),
    	$args,
    	'https'
    );

    Thank for your recommendation.
    Now i will open new issue, but i just see if they is not too friendly (many ticket not respond by them)

    So what your recommmendation until they fix the problem?
    What can i do to fix that, until the respond my ticket.

    Thank you

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’m afraid I can’t really suggest a work-around, as it would involve editing the Recent Posts Widget Extended plugin files.

    You’ll need to continue to use local images until the plugin is patched.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    What Recent Post plugin (that have filtering by single or multiple categories or tags features) that you recommend and have support with photon.

    I don’t know of any, but I’m not really familiar with Recent Post plugins I’m afraid. I’d recommend looking for options in the plugin directory and giving them a try.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Nice, I didn’t know about that plugin!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Using Photon just for Internal Image’ is closed to new replies.