You shouldn’t add functionality to themes. Or even worse: To templates. Wrap it up in a plugin and load the plugins bootstrap on plugins_loaded
, or – in case of a mu-plugin – on muplugins_loaded
.
In every case, you shouldn’t throw around with globals. Just add your output to a custom filter or hook and only add this one to your template: (Example) do_action( 'facebook_app_data' );
Related Posts:
- Official Facebook Connect button as PNG
- Use Device Login on Smart TV / Console
- Invisible characters – ASCII
- When do I need a fb:app_id or fb:admins?
- Warning: Each child in an array or iterator should have a unique “key” prop. Check the render method of `ListView`
- og:url is driving me crazy?
- Face recognition via facebook API
- FB is not defined javascript
- What are App Domains in Facebook Apps?
- How can I control the Facebook like image? [closed]
- Automatically Facebook Debug Posts on Publish [closed]
- Get FaceBook Friend Count [closed]
- W3 Cache plugin and Facebook sharing [closed]
- FB – Comment Moderation Tool bug? [duplicate]
- Facebook sharer and parameters in URL
- How to control Facebook share information for the front page?
- Adding a “most liked post” box, based on facebook ranking?
- Open graph metadata isn’t pulled on Facebook until after I run that specific link through the debugger
- How to generate “og:image” meta for Facebook sharing when the image in the post is not featured?
- Facebook Like Button in Jetpack [closed]
- Open graph problem: Showing wrong description of homepage while sharing on Facebook [closed]
- Simple plugins to post info about new blog entries?
- Facebook link to website logo
- Get User’s Facebook Photos as WordPress Upload
- Trigger a function immeditely after a user posted a comment
- Hiding styles from Facebook
- RSVP form for Facebook events from a WordPress post?
- WP_Cron script not updating all posts in loop
- How to let user select role upon registration in Facebook-AWD?
- How to preserve exact formatting when copy pasting from Facebook into WordPress (or elsewhere)?
- Send Facebook server-side event using shortcode and Official Facebook Pixel plugin
- Posting to Facebook via WordPress – 500 Internal Error
- Remove text from my Facebook posts
- How can I echo og:video url, if the post has video content?
- fb share site shows blank image
- Facebook / LinkedIn share page – https opengraph issues [closed]
- How to integrate Facebook Share button without code?
- Facebook preview Open Graph Object Debugger
- Facebook share functionality in wordpress loop
- Integrating Facebook calender to WordPress
- Open Graph in posts loop page
- Is there a way of putting the facebook social plugins into page template php files?
- Conditional Facebook Share and Like links [closed]
- Whenever I am sharing a post wordpress phrase is automatically added, can anyone help?
- Post image lacking when pasting link into Facebook despite the correct og:image meta tag
- Trouble displaying featured image as thumbnail when using Facebook share
- Website Preview Graphic for WordPress Site
- How do I set a featured image for the homepage? [closed]
- Can’t access site after plugin activation
- Use Facebook PHP SDK from WPBook
- Integrate open graph protocol without plugin?
- Adding a list of social media links
- Facebook share image wrong on post not on debugger [closed]
- No post image when pasting link into Facebook
- Facebook Registration Tool: how to use in WordPress? [closed]
- Facebook Like – Display counter starting at Zero?
- How to see more WordPress images when posting to Facebook
- WP REST API – log in with Facebook
- How to implement custom buttons into individual posts?
- “This site is under development” when sharing on Facebook
- How to use author’s avatar as Facebook post preview image when a single post is shared
- Store SNS share value via function.php
- SFC Problem with the comment login
- Single article separated into multiple pages makes Facebook Like button detect as completely separated articles
- Simple Facebook Connect: Access tokens not found
- Unprotected page appears protected when posted to Facebook (S2Member)
- Facebook comment url is unreachable
- WordPress > Error when pasting link into Facebook
- WP / Facebook integration – recently read articles
- open graph image being overwritten by gravatar logo?
- FB like adds WordPress install screen text to the wall
- Multiple account integration with facebook
- How to transfer the Facebook instance articles from one WordPress to another WordPress with same domain name?
- Set Canonical URL to GIF for Facebook
- Featured image not showing on facebook share
- image share on facebook missing
- Facebook sharing content problem
- Featured Image and Facebook
- Disable Jetpack Publicize for blog but keep for custom post type [closed]
- FaceBook fan-block in a text-widget
- How not to show author’s name when sharing blogposts on Facebook?
- Facebook posts on wordpress blog
- subscribe to wp through a Faceboo app
- Create Mashable Follow-like Facebook, Twitter login/connect?
- facebook like on twenty eleven
- How to make a share-this window drop when reaching end of post?
- Problem with Simple Facebook Connect
- Right Facebook Open Graph Protocol into WordPress theme?
- get facebook status
- Problem embedding a page on facebook [closed]
- Facebook Comments not working in WordPress [closed]
- Facebook Share button wont recognize embedded video [closed]
- Post on facebook when I publish blog
- WordPress Site login problem with facebook, twitter and other social media
- How Facebook.com knows about duplicate pages on my site?
- get avatar from facebook graph [closed]
- Force Jetpack to use og:url with http on an https website
- Facebook video on a post appears in a strange language [closed]
- Bigger images when sharing a link with facebook
- How to write ‘post to facebook’ action in Uncanny Automator