Conditionally write open graph meta property in header

From what I understand, you need help framing your if logic? And the php tags usage dont look right either. Does this help – <?php if(!is_single()){ if(is_home() || is_front_page()){ // not sure if you have set a static page as your front page echo ‘<meta property=”og:url” content=”‘.bloginfo(‘url’); .'” />’; }elseif(is_tag()){ echo ‘<meta property=”og:url” content=”‘.$_SERVER[“HTTP_HOST”] . … Read more

How do I add Facebook OpenGraph meta tags for attachments in the header for a custom theme?

$attachment_id is simply the numerical ID assigned to any media you have uploaded. You can write: echo wp_get_attachment_image(‘1′,’large’); to display the large size of image attachment with ID of 1. You should setup a new query to get all of the attachment IDs associated with the current post, then you can get_posts(‘post_type=attachment’) Check this example … Read more