Created
November 15, 2014 18:08
-
-
Save iraycd/67c59236d2adb05afe21 to your computer and use it in GitHub Desktop.
Update Header Woocommerce Open Graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( is_home() ) { // If on the homepage ?> | |
<!--/ Open Graph for Homepage /--> | |
<meta property="og:title" content="<?php echo get_bloginfo(strip_tags('name')) ?>" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:url" content="<?php echo home_url() ?>" /> | |
<meta property="og:description" content="<?php echo get_bloginfo (strip_tags('description')) ?>" /> | |
<meta property="og:site_name" content="<?php echo get_bloginfo(strip_tags('name')) ?>" /> | |
<meta property="og:image" content="http://unglove.me/path-to-thumbnail-image.jpg" /> | |
<?php } ?> | |
<?php if ( is_woocommerce() ) { // If on a woocommerce page ?> | |
<!--/ Open Graph for Woo Product /--> | |
<meta property="og:title" content="<?php echo get_the_title() ?>" /> | |
<meta property="og:type" content="product" /> | |
<meta property="og:url" content="<?php echo get_permalink() ?>" /> | |
<meta property="og:description" content="<?php echo get_the_excerpt() ?>" /> | |
<meta property="og:site_name" content="<?php echo get_bloginfo(strip_tags('name')) ?>" /> | |
<meta property="og:image" content="<?php $featuredimg = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full"); echo $featuredimg[0]; ?>" /> | |
" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment