WordPress.org

Support

Support » Multisite » How do I add custom theme files to a network site?

How do I add custom theme files to a network site?

  • Michelle Langston

    @chellycat

    Theme Wrangler at Automattic

    I have a theme installed on my multisite network that uses Child Themes to make changes. I want to create my own version of a file on one of the sites in my network (let’s call it Site #2) and add it to the Child Theme in use on Site 2. For example, I want to create a custom “comments.php” in the Child Theme for Site #2.

    However, since Site #2 is “virtual”, it does not not have an actual folder on the server. So is it impossible to create a custom template file for that site?

Viewing 3 replies - 1 through 3 (of 3 total)
  • global $blog_id;
    if( $blog_id == '2' ) {
    //do some comment stuff for blog 2
    }
    Michelle Langston

    @chellycat

    Theme Wrangler at Automattic

    Hi, thanks for the reply and sorry it took so long for me to respond, got sidetracked in a major way, lol! So would I put that code in functions.php? What if the owner of Site 2 was a client? Where would he/she put that code?

    You’d put it in your comments.php.

    global $blog_id;
    if( $blog_id == '2' ) {
    // do some comment stuff for blog 2
    }
    else {
    // The rest of your normal comments.php stuff
    }

    Option 2 would be to make a second child theme JUST for Site 2. Depends on what kind of changes you’re talking about though.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I add custom theme files to a network site?’ is closed to new replies.
Skip to toolbar