[resolved] use one header.php for multi site (2 posts)

  1. strandcreative
    Posted 2 years ago #


    We have a WordPress installation in the root directory.
    We are then having another 5 WordPress installs in different directories on the server so we can have different branches managing different content with separate logins.

    If we make changes to the header.php on the main site in the root, we woiuld like this to update on all the other 5 installs via an include file function. I've tried to use the include function to bring in the header.php from the URL but it doesn't work. Can you use a specific URL in the include function?


    Is there an easier method that I'm missing where we can get those changes to update on all the other installs via one header.php template?

  2. LeRedac
    Posted 1 year ago #

    include (TEMPLATEPATH . '/header.php');

    or if you whant one header per blog use something like this :

    // Exenple whith :
    // ID Web name Site 1 = 1 << First Blog (principal)
    // ID Web name Site 2 = 2
    // ID Web name Site 3 = 3
    // ID Web name Site 4 = 4
    // Get current Blog ID
    $blog_id = get_current_blog_id();
    // Get Theme directory url
    // Make conditions
    if     ($blog_id =="2"){include (TEMPLATEPATH . '/header2.php');}
    elseif ($blog_id =="3"){include (TEMPLATEPATH . '/header3.php');}
    elseif ($blog_id =="4"){include (TEMPLATEPATH . '/header4.php');}
    else { include (TEMPLATEPATH . '/header.php');} // Else = ID 1 - First Blog

Topic Closed

This topic has been closed to new replies.

About this Topic