Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <meta property="og:title" content="<?php global $page, $paged; wp_title( '«', true, 'right' ); bloginfo( 'name' ); if ( $paged >= 2 || $page >= 2 ) echo ' » ' . sprintf( __( 'Page %s' ), max( $paged, $page ) ); ?>" />
- <?php if (is_single()OR is_page()) { ?>
- <meta property="og:type" content="article" />
- <meta property="og:url" content="<?php the_permalink() ?>" />
- <?php }else{ ?>
- <meta property="og:type" content="website" />
- <meta property="og:url" content="<?php bloginfo('siteurl'); ?>/" />
- <?php } ?>
- <meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
- <meta property="og:description" content="<?php set_meta_description(); ?>" />
- <?php if (is_single()&& has_post_thumbnail()) { ?>
- <meta property="og:image" content="<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 300, 300 ), false, '' ); echo $src[0]; ?>" />
- <meta property="og:image:width" content="200" />
- <meta property="og:image:height" content="200" />
- <?php }else{ ?>
- <meta property="og:image" content="<?php bloginfo('siteurl'); ?>/wp-content/themes/MyTheme/images/preview.jpg" />
- <meta property="og:image:width" content="200" />
- <meta property="og:image:height" content="200" />
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement