I have the following code in my functions.php file
function read_tumblr_content() {
$sk_social_tumblr = get_option('social_tumblr');
$url = "http://".$social_tumblr.".tumblr.com/api/read/json";
if(function_exists("curl_version")) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($c, CURLOUT_RETURNTRANSFER, 1);
$output = curl_exec($c);
curl_close($c);
}
else {
$output = "error: cannot fetch feed";
}
$output = "test";
return $output;
}
But when I simply call it from my template index.php like this:
$myvar = read_tumblr_content();
I keep getting the complete json string output in my browser, even though I've overridden the output to "test". Any help would be appreciated.