WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. w1nk5
    Member
    Posted 3 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.

    Thanks

  2. David Sader
    Member
    Posted 3 years ago #

    This should work:

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

    Worked like a Charm. Thanks a lot!

  4. Cerebral ideas
    Member
    Posted 3 years ago #

    Awesome, thanks David!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.