i have a multisite in which people pay to upgrade to adfree. I have a list of blog id’s that are from upgraded sites. I am trying to place code in the page that gets the current blog id but it doesnt seem to work. i am always getting site id 1 returned. Any ideas?
<?php
$current_site = get_current_site();
$id = $current_site->id;
echo $id;
$os = array(267,156, 98,654);
if (in_array($id, $os)) {
echo "dont display ads";
}
?>
thanks
EDIT. Working Code
<?php
global $blog_id;
$os = array(286,156, 98,654);
if (in_array($blog_id, $os)) {
echo "dont display ads";
}
?>
You are missing
$
sign from in front of idalso ensure that $current_site->id does return a number (like
98
for example, not'98,654'
string (or float) )