title: Specify og:image for particular pages
body: <p>I am trying to add open graph meta data for og:image via custom field on Wordpress reference to this <a href="https://www.webhostinghero.com/how-to-specify-the-facebook-ogimage-tag-in-wordpress/" rel="nofollow noreferrer">link</a> but it does not work for me. Is this function correct? I am following all steps same. </p>
  
  <p>PS: I dont use plugin for SEO</p>
  
  <p>thanks</p>
  
  <p><a href="https://i.stack.imgur.com/cBeR5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cBeR5.jpg" alt="Custom field"></a></p>
  
  <pre><code>function insert_og_image() {
  
  if(get_post_meta(get_the_ID(), 'og_image', true) &amp;&amp; is_single()) {
  $output = '&lt;meta property="og:image" content="'. get_post_meta(get_the_ID(), 'og_image', true) .'" /&gt;';
  }
  
  echo $output;
  }
  add_action('wp_head','insert_og_image');
  </code></pre>