Support » Plugin: Facebook » Adding fallback description and image to OG meta info

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Niall Kennedy

    (@niallkennedy)

    The plugin builds a set of defaults for the currently loading WordPress page. The page might be your website’s homepage, an author page, or an individual post.

    You can act on multiple properties of the page such as title and description. The example adds a new image. To add a description where none exists you might add code similar to the following:

    if ( ! isset( $meta_tags['http://ogp.me/ns#description'] ) )
    	$meta_tags['http://ogp.me/ns#description'] = 'You will want to read this';

    A full list of Open Graph protocol properties is available at ogp.me.

    Yeah, this is for “pages” that have post text or excerpt. And then there are posts that have no images, which is on purpose, like here…

    http://turtleneckclub.com/2013/03/why-do-you-say-life-was-never-meant-to-be-cheap/

    So combining the above that you’ve posted and the earlier example I posted will hopefully be painless. I suppose a bit of hacking never hurt anyone. I’ll have to see what I can do. Thank you so much! And if you have any friends in London, send them right along to our get together on the 18th. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding fallback description and image to OG meta info’ is closed to new replies.