Answers for "og meta html"

0

meta og:image

<meta property="og:image" content="https://example.com/ogp.jpg" />
<meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />
<meta property="og:image:alt" content="A shiny red apple with a bite taken out" />
Posted by: Guest on November-19-2020
0

og tags example

<?php if (have_posts()):while(have_posts()):the_post(); endwhile; endif;?>  
<meta property="fb:admins" content="your_fb_admin_id" />  
$facebook_image= catch_that_image();  
<?php if (is_single()) { ?>  
<meta property="og:url" content="<?php the_permalink() ?>"/>  
<meta property="og:title" content="<?php single_post_title(''); ?>" />  
<meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>" />  
<meta property="og:type" content="article" />  
<meta property="og:image" content="<?php if (function_exists('wp_get_attachment_thumb_url')) {echo wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID)); }?>" />  

<?php } else { ?>  
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />  
<meta property="og:description" content="<?php bloginfo('description'); ?>" />  
<meta property="og:type" content="website" />  
<meta property="og:image" content="<?php echo $facebook_image;?>" /> <?php } ?>
Posted by: Guest on April-17-2021
0

all meta og tags

<meta property="og:locale" content="en_GB" />
Posted by: Guest on December-18-2020

Browse Popular Code Answers by Language