Support » Networking WordPress » How to get the current site's/blog's ID?

  • Resolved jumust

    (@jumust)


    Hi,
    I’d like to display different links for each of my blog in my network, so that if is Blog1 will display different links than Blog2. I’m trying to use this code but it doesn’t display anything.

    <?php
    global $blog_id;
    if ($blog_id == 4) {
       //First blog links
    } else {
       //Default links <a href="http:\\example.com>example</a>
    }
    ?>

    Is that wrong?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get the current site's/blog's ID?’ is closed to new replies.