Support » Networking WordPress » How to show something depending on the blog title

  • Hi!

    Please, i need a little help for my WordPress Multisite. I use the same template for all the sites (subdomains) of my multisite, and i need to be able to show something depending on the blog title (or some titles) (wp_title),

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Use blog ID to change:

    <?php
    global $blog_id;
    if ($blog_id == 1) {
       //do something
    } else {
       //do something else
    }

    Thank you very much, added and working well. How can i do it with several Id’s?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Use several ifs.

    <?php
    global $blog_id;
    if ($blog_id == 1) {
       //do something
    } if ($blog_id == 2) {
       //do something for 2
    } else {
       //do something else
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show something depending on the blog title’ is closed to new replies.