WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Default Setting for Social Image doesn't work (10 posts)

  1. Tanjim Shaikat
    Member
    Posted 1 year ago #

    WordPress version: 3.3.2
    WordPress SEO version: Development Version

    Social > Frontpage settings > Image URL
    This is working fine.

    But

    Social > Default Settings > Image URL
    This function is not working.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    How is it not working? Please describe what you're doing, what you're expecting the plugin to do and what it does instead.

  3. Tanjim Shaikat
    Member
    Posted 1 year ago #

    I have set this values,

    Frontpage settings
    Image URL: http://lh5.googleusercontent.com/-4rodJiXhe4Y/T9IB3opsD5I/AAAAAAAAAWA/43Maw6IHHAk/s200/fb-og.jpg
    Description: The Supreme Point of Complexity and Consciousness

    Default settings
    Image URL: http://lh5.googleusercontent.com/-4rodJiXhe4Y/T9IB3opsD5I/AAAAAAAAAWA/43Maw6IHHAk/s200/fb-og.jpg

    The Frontpage settings Result : http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Ftanjimshaikat.com
    It's working greatly. The Image is showing.

    But,

    The Default Settings Result : http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Ftanjimshaikat.com%2Fhimu%2Fhimur-babar-upodesh%2Fnirliptota%2F
    Here, The image is not showing.

  4. ionainteractive
    Member
    Posted 1 year ago #

    I can confirm the bug report. I suggest adding the following code or similar at line 241 of /frontent/class-opengraph.php:

    ------------------
    if ( !count($shown_images) && isset( $this->options['og_default_image'] ) )
    $og_image = $this->options['og_default_image'];

    $og_image = apply_filters( 'wpseo_opengraph_image', $og_image );

    if ( isset( $og_image ) && $og_image != '' )
    echo "<meta property='og:image' content='".esc_attr( $og_image )."'/>\n";
    ------------------

    This is basically just a copy of the snippet from the is_singular() else case immediately below. I think this was what was intended here but was omitted in oversight.

  5. Tanjim Shaikat
    Member
    Posted 1 year ago #

    Won't there be any official solution for this on next updated version?

  6. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    Ugh. Seriously, one more time: please read this thread and follow the instructions there. If the issue persists, try to formulate your problem using the template in that post. I can't do anything based on what you're telling me here.

  7. ionainteractive
    Member
    Posted 1 year ago #

    Hi Joost, sorry for any confusion though I am not the OP...

    WordPress version: 3.4
    WordPress SEO version: 1.2.2

    I did this:

    (1) I created a page without a Featured Image set using a theme which supports Featured Images. The page does not contain an <img> in the content body.
    (2) Under SEO > Social, I set the value for a default image under "Default settings / Image URL."

    I expected the plugin to do this:

    When viewing the page, I expected to see an "og:image" meta tag in <head> with the URL that I specified for the default image.

    Instead it did this:

    No "og:image" meta tag appears in the page output.

    What I recommend:

    As I attempted to explain above, you are missing any consideration of the default image setting un frontend/class-opengraph.php. For the is_singular() case, you check:

    (a) if this is the front page,
    (b) if the post/page has a thumbnail, and
    (c) if the post/page contains an <img>.

    What's missing is a step d where, failing cases a-c, you check whether there is a default image URL specified in options and display that as the og:image. There is a code block for the is_singular() else case (lines 251-257) which I adapted slightly in my sample fix three messages up from this one.

  8. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    Ah. Ok, i finally get it, sorry for being daft. It should be fixed in the development version, could you please veriyf? You can download the development version from here, or you can download it directly here.

  9. ionainteractive
    Member
    Posted 1 year ago #

    Yes, that's perfect -- thanks for all you do! :-)

  10. Joost de Valk
    Member
    Plugin Author

    Posted 1 year ago #

    Awesome. Ok, closing this thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.