0

I have a little problem that I can not solve. I have a website "multi-site" system with ADS PRO scripteo. I wish I could enter leaderboard banner.

After that I created the shortcode:

[bsa_pro_ad_space id=2]

At this point I give shortcode in php code:

<?php


if(do_shortcode('[bsa_pro_ad_space id=2]')) {
    echo '
      <div id="bnftr">
'.do_shortcode('[bsa_pro_ad_space id=2]').'
      </div>';
} else {
    echo '
      <div id="bnftr-none"></div>';
}

this works well.

The problem is this: since in a subdomain the banner will have a ads and in another subdomain banner should have a different banner and not the same throughout the network.

I wrote the code this way:

<?php


if ( get_current_blog_id() = 1 ) {

if(do_shortcode('[bsa_pro_ad_space id=1]')) {
    echo '
      <div id="bnftr">
'.do_shortcode('[bsa_pro_ad_space id=1]').'
      </div>';
} else {
    echo '
      <div id="bnftr-none"></div>';
}

} elseif ( get_current_blog_id() = 2 ) {

if(do_shortcode('[bsa_pro_ad_space id=2]')) {
    echo '
      <div id="bnftr">
'.do_shortcode('[bsa_pro_ad_space id=2]').'
      </div>';
} else {
    echo '
      <div id="bnftr-none"></div>';
}

}

when I update the page home page remains black screen. you only see the logo. (I wish the blog ID 1 there is a banner, and the blog ID 2, another banner)

can someone help me !?

0

At first glance, you're assigning values to get_current_blog_id instead of comparing them. That is

get_current_blog_id() = 1

should be

get_current_blog_id() === 1

in both places.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.