• Mauricio

    (@mauriciogarofalo)


    I have share and publizice enabled but I cant add a dafault image if nothing found when sahreing to Facebook.

    Default picture for home works fine but if I share for example, a category page nothing is shown.

    function custom_jetpack_default_image() {
        return 'http://www.******.com/wp-content/uploads/logos/facebook-default.jpg';
    }
    add_filter( 'jetpack_open_graph_image_default', 'custom_jetpack_default_image' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Could you post your site URL here, so I can have a look?

    If you want it to remain private, you can also contact us via this contact form:
    http://jetpack.com/contact-support/

    Thread Starter Mauricio

    (@mauriciogarofalo)

    Yes http://goo.gl/4Wfx4r

    A few minutes ago just tried the same url and this time show me some random image to choose from. But, please take a look if you can. I pasted the main url.

    Thanks,
    Mauricio

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Thanks for the extra details. I’m afraid that’s a bug in Jetpack, and something we’ll need to fix in a future release.
    You can follow our progress here:
    https://github.com/Automattic/jetpack/issues/1987

    Until the issue is fixed, you could use the following code to add that Open Graph Image to your archive pages:

    function custom_jetpack_default_image() {
    	if ( is_archive() ) {
    		printf(
    			'<meta property="og:image" content="%s"/>',
    			esc_url( 'http://www.******.com/wp-content/uploads/logos/facebook-default.jpg' )
    		);
    	}
    }
    add_action( 'wp_head', 'custom_jetpack_default_image' );
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Default image used for Facebook not working’ is closed to new replies.