StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-07-2011, 06:36 PM
teyonas teyonas is offline
Registered User
Genesis Member
 
Join Date: Jan 2009
Posts: 76
Default Facebook Open graph tags not working

I'm trying to get the Facebook Open graph tags for posts working, but they don't apear in the the post header no matter what I do. I'm using this code in functions.php file and Lifestyle 3.0 theme:

PHP Code:
<?php

// Paste into Functions.php, anywhere between the PHP tags

add_action('wp_head''add_fb_open_graph_tags');
function 
add_fb_open_graph_tags() {
    if (
is_single()) {
        global 
$post;
        if(
get_the_post_thumbnail($post->ID'thumbnail')) {
            
$thumbnail_id get_post_thumbnail_id($post->ID);
            
$thumbnail_object get_post($thumbnail_id);
            
$image $thumbnail_object->guid;
        } else {    
            
$image 'http://www.bodieko.si/foto/2011/04/eko.jpg'// Change this to the URL of the logo you want beside your links shown on Facebook
        
}
        
$description get_bloginfo('description');
?>
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<?php echo $image?>" />
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:description" content="<?php echo $description ?>" />
<meta property="og:site_name" content="<?php echo get_bloginfo('name'); ?>" />
<meta property="fb:admins" content="000000000000" />
<?php     }
}

// Update your fb:admins to your user or page ID
?>
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
facebook cant access meta tags when sharing ayfwest General Discussion 5 10-15-2010 04:59 PM
Open-Realty Inside my AgentPress Site not working dominatenet General Discussion 6 03-19-2010 05:17 PM
Meta Tags for Facebook Links thepranamama General Discussion 2 02-18-2010 08:23 PM
Adding Google Analytics and seeing graph on Dashboard. ddalton General Discussion 3 01-25-2010 10:34 PM


All times are GMT -5. The time now is 09:09 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.