The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Check if site is main site in network. (4 posts)

  1. w1nk5
    Posted 5 years ago #

    Is there a way to check if the current site is the main site for the network or a subsite?

    My network sites use a child theme of the main site theme that shares the main themes header. I want to be able to change some content in the header based on a condition if it is the main site or a subsite.


  2. David Sader
    Posted 5 years ago #

    This should work:

    global $blog_id;
    if($blog_id != 1) {...}
  3. w1nk5
    Posted 5 years ago #

    Worked like a Charm. Thanks a lot!

  4. Cerebral ideas
    Posted 5 years ago #

    Awesome, thanks David!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.