Can anyone tell me why this code in a wordpress 'page template' doesn't execute?
'Echo' seem to work but all 'include' and 'print_r()' and other functions don't. This exact code works on my home server but not on wordpress hosted site:
<?php
/**
* Template Name: fbshares
*
* A custom page template for displaying all posts.
*
* The "Template Name:" bit above allows this to be selectable
* from a dropdown menu on the edit page screen.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
get_header(); ?>
<div id="container">
<div id="content" role="main" class="fullpagejoel">
<?php
echo "x";
$url = "http://www.google.com";
$social = array(
'twitter' => 'http://cdn.api.twitter.com/1/urls/count.json?url=',
'facebook' => 'https://graph.facebook.com/',
'stumbleupon' => 'http://www.stumbleupon.com/services/1.01/badge.getinfo?url='
);
$json = file_get_contents($social['twitter'].$url, false);
$a = json_decode($json, true);
$r['twitter'] = $a['count'];
print_r($a);
echo count($a).' [OK]';
?>