<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Topic: How to: Facebook Open Graph &#60;meta&#62;</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Mon, 20 May 2013 01:11:06 +0000</pubDate>

<item>
<title>sunysky on "How to: Facebook Open Graph &#60;meta&#62;"</title>
<link>http://themeshaper.com/forums/topic/how-to-facebook-open-graph-ltmetagt#post-16858</link>
<pubDate>Tue, 09 Nov 2010 23:33:14 +0000</pubDate>
<dc:creator>sunysky</dc:creator>
<guid isPermaLink="false">16858@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;It works!&#60;br /&#62;
Thank a lot Chris! :)
&#60;/p&#62;</description>
</item>
<item>
<title>Chris on "How to: Facebook Open Graph &#60;meta&#62;"</title>
<link>http://themeshaper.com/forums/topic/how-to-facebook-open-graph-ltmetagt#post-16848</link>
<pubDate>Tue, 09 Nov 2010 20:02:44 +0000</pubDate>
<dc:creator>Chris</dc:creator>
<guid isPermaLink="false">16848@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;It should be add_filter.&#60;/p&#62;
&#60;p&#62;Chris
&#60;/p&#62;</description>
</item>
<item>
<title>sunysky on "How to: Facebook Open Graph &#60;meta&#62;"</title>
<link>http://themeshaper.com/forums/topic/how-to-facebook-open-graph-ltmetagt#post-16846</link>
<pubDate>Tue, 09 Nov 2010 16:33:34 +0000</pubDate>
<dc:creator>sunysky</dc:creator>
<guid isPermaLink="false">16846@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;When I try your solution my wordpress crash and I obtain this error message:&#60;/p&#62;
&#60;p&#62;Fatal error: Call to undefined function apply_filter() in /public_html/photo/wp-content/themes/autofocusplus/functions.php on line 36&#60;/p&#62;
&#60;p&#62;The line 36 is:&#60;br /&#62;
apply_filter('thematic_create_doctype', 'open_graph_doctype');&#60;/p&#62;
&#60;p&#62;I have wordpress 3.0.1 with Autofocus+ theme wich is based on Thematic theme.&#60;br /&#62;
&#60;a href=&#34;http://fthrwght.com/autofocus/&#34; rel=&#34;nofollow&#34;&#62;http://fthrwght.com/autofocus/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Do you know where is the problem? &#60;/p&#62;
&#60;p&#62;Thank you in advance!&#60;/p&#62;
&#60;p&#62;PS: excuse my english, i'm french...
&#60;/p&#62;</description>
</item>
<item>
<title>Ben W. on "How to: Facebook Open Graph &#60;meta&#62;"</title>
<link>http://themeshaper.com/forums/topic/how-to-facebook-open-graph-ltmetagt#post-12840</link>
<pubDate>Sun, 06 Jun 2010 11:35:16 +0000</pubDate>
<dc:creator>Ben W.</dc:creator>
<guid isPermaLink="false">12840@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;If you are using the Facebook “Like” button on your page, you may want to have a better control over it – including an Admin page. (&#60;a href=&#34;http://developers.facebook.com/docs/opengraph?info=EXLINK&#34;&#62;More about Open Graph protocol.&#60;/a&#62;)&#60;/p&#62;
&#60;p&#62;You'll need a logo image for your blog and put it to your Thematic /images/ directory, or, if you are using a child theme, to your child themes /images/ directory. Put the following code snippet to your functions.php of Thematic, or, if you are using a child theme, of your child theme:&#60;/p&#62;
&#60;p&#62;(If you need to find out your Facebook ID, click on the &#34;Photos&#34; tab of your FB profile, select your profile photos, and grab the number of the &#60;a href=&#34;http://www.facebook.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.facebook.com/&#60;/a&#62;…&#38;#38;id=YOUR_ID part.)&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/*
 * Facebook Open Graph
 */
function open_graph($content) {
	$content .=&#38;#39;&#38;lt;meta property=&#38;quot;fb:admins&#38;quot; content=&#38;quot;YOUR_FACEBOOK_ID&#38;quot; /&#38;gt;&#38;#39; . &#38;quot;\n&#38;quot;;
	if (is_home() &#124;&#124; is_front_page()) {
		$url = get_option(&#38;#39;home&#38;#39;);
		$title = get_bloginfo(&#38;#39;name&#38;#39;);
		$description = get_bloginfo(&#38;#39;description&#38;#39;);
		$article = &#38;#39;blog&#38;#39;;
	} else {
		global $post;
		$url = get_permalink($post-&#38;gt;ID);
		$title = get_the_title();
		$description = get_the_excerpt();
		$article = &#38;#39;article&#38;#39;;
	}
	$content .=&#38;#39;&#38;lt;meta property=&#38;quot;og:site_name&#38;quot; content=&#38;quot;&#38;#39; . get_bloginfo(&#38;#39;name&#38;#39;) . &#38;#39;&#38;quot; /&#38;gt;&#38;#39; . &#38;quot;\n&#38;quot;;
	$content .=&#38;#39;&#38;lt;meta property=&#38;quot;og:title&#38;quot; content=&#38;quot;&#38;#39; . $title . &#38;#39;&#38;quot; /&#38;gt;&#38;#39; . &#38;quot;\n&#38;quot;;
	$content .=&#38;#39;&#38;lt;meta property=&#38;quot;og:description&#38;quot; content=&#38;quot;&#38;#39; . $description . &#38;#39;&#38;quot; /&#38;gt;&#38;#39; . &#38;quot;\n&#38;quot;;
	$content .=&#38;#39;&#38;lt;meta property=&#38;quot;og:type&#38;quot; content=&#38;quot;&#38;#39; . $article . &#38;#39;&#38;quot; /&#38;gt;&#38;#39; . &#38;quot;\n&#38;quot;;
	$content .=&#38;#39;&#38;lt;meta property=&#38;quot;og:url&#38;quot; content=&#38;quot;&#38;#39; . $url . &#38;#39;&#38;quot; /&#38;gt;&#38;#39; . &#38;quot;\n&#38;quot;;
	$content .=&#38;#39;&#38;lt;meta property=&#38;quot;og:image&#38;quot; content=&#38;quot;&#38;#39; . get_bloginfo(&#38;#39;stylesheet_directory&#38;#39;) . &#38;#39;/images/YOUR_LOGO.jpg&#38;quot; /&#38;gt;&#38;#39; . &#38;quot;\n&#38;quot;;
	return $content;
}
add_filter (&#38;#39;thematic_create_description&#38;#39;, &#38;#39;open_graph&#38;#39;);

function open_graph_doctype($content) {
	$content = &#38;#39;&#38;lt;!DOCTYPE html PUBLIC &#38;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&#38;quot;
	&#38;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#38;quot;&#38;gt;&#38;#39;;
	$content .= &#38;#39;&#38;lt;html xmlns=&#38;quot;http://www.w3.org/1999/xhtml&#38;quot; xmlns:og=&#38;quot;http://opengraphprotocol.org/schema/&#38;quot; xmlns:fb=&#38;quot;http://www.facebook.com/2008/fbml&#38;quot;&#38;#39;;
	return $content;
}
apply_filter(&#38;#39;thematic_create_doctype&#38;#39;, &#38;#39;open_graph_doctype&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Please note that the document won't validate as XHTML 1.0 Transitional anymore. Changing it to the required DOCTYPE XHTML + RDFa (&#60;code&#62;&#38;lt;!DOCTYPE html PUBLIC &#38;quot;-//W3C//DTD XHTML+RDFa 1.0//EN&#38;quot; &#38;quot;http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd&#38;quot;&#38;gt;&#60;/code&#62;) would make it almost like XHTML 1.1, which is Strict, but will easily brake existing forms etc.&#60;/p&#62;
&#60;p&#62;If you are not using a caching solution (like WP Super Cache or Hyper Cache), you could restrict the meta tags to be shown the Facebook crawler only:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function open_graph($content) {
	if ($_SERVER[&#38;#39;HTTP_USER_AGENT&#38;#39;] == &#38;#39;facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php)&#38;#39;) {
	[the stuff from above]
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Enjoy!
&#60;/p&#62;</description>
</item>

</channel>
</rss>
