This file contains hidden or 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
| //Add Open Graph Meta Info from the actual article data, or customize as necessary | |
| function insert_fb_in_head() { | |
| global $post; | |
| if ( !is_singular()) //if it is not a post or a page | |
| return; | |
| //You'll need to find you Facebook profile Id and add it as the admin | |
| echo '<meta property="fb:admins" content="XXXXXXXXX-fb-admin-id"/>'; | |
| echo '<meta property="og:title" content="' . get_the_title() . '"/>'; | |
| echo '<meta property="og:type" content="article"/>'; | |
| echo '<meta property="og:url" content="' . get_permalink() . '"/>'; |
This file contains hidden or 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
| function add_opengraph_doctype($output) { | |
| return $output . ' | |
| xmlns="https://www.w3.org/1999/xhtml" | |
| xmlns:og="https://ogp.me/ns#" | |
| xmlns:fb="http://www.facebook.com/2008/fbml"'; | |
| } | |
| add_filter('language_attributes', 'add_opengraph_doctype'); |
NewerOlder