skip to Main Content

Insert og:image in wordpress – SEO

I have the following hook for facebook's og:image tag. In my template file: <?php do_action('wp_head', $mypost) ?> In my functions file: add_action('wp_head', 'add_fb_og'); function add_fb_og($mypost) { if (isset($mypost["wpcf-bgleft"][0])) { echo '<meta property="og:image" content="'.$mypost["wpcf-bgleft"][0].'" />'; } } What I'm trying to…

VIEW QUESTION
Back To Top
Search