Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marcin Pietrzak

    (@iworks)

    hi @premmarga

    Yes it is possible, you have to use og_og_image_value filter to change it:

    https://wordpress.org/plugins/og/#how%20to%20filter%20values%3F

    Please remember, at least, to unset values (better is set it to correct values with proper filter, eg. for og:image:width it isog_og_image_width_value):

    og:image:width
    og:image:height
    og:image:alt
    og:image:type

    At least, code:

    
    <?php
    add_filter( 'og_og_image_value', 'premmarga_og_og_image_value' );
    function premmarga_og_og_image_value( $img_url ) {
        return 'https://example.com/logo.png';
    }
    

    have a nice day!

    Marcin

    • This reply was modified 4 years, 5 months ago by Marcin Pietrzak. Reason: typo
    Thread Starter premmarga

    (@premmarga)

    sorry Marcin,
    I don´t get it?
    does this mean I don´t need your plugin?

    but have to change function.php
    I have a childtheme in this website.
    but I don´t really get it

    can I just copy your code, or do I have to change something
    like premmarga
    or https://example.com/logo.png

    please give me another hint….

    thank you for the quick respond,
    and i`m still learning in this wordpress world and not really into php

    Marga

    Plugin Author Marcin Pietrzak

    (@iworks)

    @premmarga

    This code changes output of my plugin. Please add it to your functions.php, but change logo url to proper one:

    
    add_filter( 'og_og_image_value', 'premmarga_og_og_image_value' );
    function premmarga_og_og_image_value( $img_url ) {
        return 'https://example.com/logo.png';
    }
    

    Marcin

    Thread Starter premmarga

    (@premmarga)

    Thank you marcin,,

    it works,
    great

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

The topic ‘logo in social medias’ is closed to new replies.