Title: Handling single.php in Multisite
Last modified: August 30, 2016

---

# Handling single.php in Multisite

 *  Resolved [bmc1416](https://wordpress.org/support/users/bmc1416/)
 * (@bmc1416)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/handling-singlephp-in-multisite/)
 * I’m using sub directories for my WordPress multisite, posts are controlled with
   single.php. How can instruct single.php to use a different header and footer 
   file for the site in the sub directory?
 * I tried using get_current_blog_id but that didn’t seem to work. For example:
 *     ```
       $current_blog = get_current_blog_id();
   
       if ($current_blog == 2) {
           get_template_part('header', 'blog2');
       } else {
           get_header();
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [bmc1416](https://wordpress.org/support/users/bmc1416/)
 * (@bmc1416)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/handling-singlephp-in-multisite/#post-6446977)
 * I was able to get away with using in_category() because I’m only using 1 category
   on the sub directory site:
 *     ```
       if (in_category('News')) {
            get_template_part('header', 'blog2');
       } else {
            get_header();
       }
       ```
   
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [10 years, 10 months ago](https://wordpress.org/support/topic/handling-singlephp-in-multisite/#post-6447036)
 * You can also use blog ID 🙂
 *     ```
       global $blog_id;
   
       if ( $blog_id == 2 ) {
           get_template_part('header', 'blog2');
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Handling single.php in Multisite’ is closed to new replies.

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [single](https://wordpress.org/support/topic-tag/single/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 2 replies
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/handling-singlephp-in-multisite/#post-6447036)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
