Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    To change the sharing link from page URL to image URL please try to use the following code snippet:

    add_action('wp_footer', 'my_wp_footer2');
    function my_wp_footer2() { ?>
        <script>
            window.addEventListener('load', function() {
                function sti_data( data ) {
                    if ( data.network === 'messenger' ) {
                        data.page = data.media;
                    }
                    return data;
                }
                if ( typeof StiHooks === 'object' && typeof StiHooks.add_filter === 'function' ) {
                    StiHooks.add_filter( 'sti_data', sti_data );
                }
            }, false);
        </script>
    <?php }

    Add this code inside your theme functions.php file or just use some code snippets plugin.

    Regards

    Thread Starter netspacer

    (@netspacer)

    Thanks that did some of it ??
    Now only the image is shared, and messenger just send a link to the image, it does not show the image.
    If i write a message when sharing, it only the text that is send, and not the image???…so almost there ??

    Plugin Author ILLID

    (@mihail-barinov)

    Did you see an image when sharing to Messenger before applying that custom code?

    Thread Starter netspacer

    (@netspacer)

    The text part works on mobile, but not on desktop.
    So the conclusion must be, that image sharing only should be allowed on mobile. That works for me.
    The image is not shown in messenger, only the link to the image, it was the same before custom code.

    Plugin Author ILLID

    (@mihail-barinov)

    For Messager you shouldn’t see the image itself. But when sharing it must be attached to the message like when you share the links to some sites.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Messenger’ is closed to new replies.