Home > wordpress > WordpressにphpでFacebookのいいね!ボタン、tweetボタン、はてブボタンを付けるコード PHP $urlget = '取得したいサイトのドメイン(htt://example.com/)' . getenv('REQUEST_URI'); $source_url = urlencode($urlget); //Facebookいいね数取得 function likeCount($str = null) { if($str) $url = $str; else $url = ((!empty($_SERVER['HTTPS']))? "https://" : "http://").$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $json = file_get_contents('htt
![WordpressにphpでFacebookのいいね!ボタン、tweetボタン、はてブボタンを付けるコード | バニデザノート](https://cdn-ak-scissors.b.st-hatena.com/image/square/288681eadf5c3dd9aab8f2ca33f4f02408a628ec/height=288;version=1;width=512/https%3A%2F%2Fblog-imgs-81.fc2.com%2Fv%2Fa%2Fn%2Fvanidesign%2F11187260_968568719828247_3343970705641289934_os.png)