Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Please elaborate on how it doesn't deliver what's expected.
    – Christine Cooper
    Commented May 3, 2016 at 16:58
  • On a multi-site main site if you use any form of is_home() or is_front_page() on a static or blog frontpage the functions will both return false. Commented May 3, 2016 at 17:12
  • 1
    I just tested both conditions on a multisite environment and both returned true when I visited the respective / pages.
    – Christine Cooper
    Commented May 4, 2016 at 9:53
  • I am using the wordpress VVV box with the multisite plugin : github.com/Varying-Vagrant-Vagrants/vvv-multisite perhaps there's something misconfigured on it? Regardless just leaving an answer for a workaround if anyone comes along with a similar situation. Commented May 4, 2016 at 13:07
  • 1
    You're code is almost perfect, the only thing is: What if WP is installed in a subdirectory, for example /blog or /wordpress. Than this will be useless. Commented Nov 2, 2018 at 8:37