Server Side Includes for Multiple Blogs on One Domain

by BytheC
1 replies
Am working with an existing (html) website that has a server side include to handle the navigation. Am planning to keep what already exists and am now adding multiple "blogs" using wordpress installations, to expand the site. Have managed to get that happening with my first few "test-blogs". So the "add ons" are
domainname.com/newblog1/
domainname.com/newblog2/
Etc.

These multiple blogs are created by copying the original files, changing one line in the config file, then installing. All are running out of the same database, just different departments of it.

I want to integrate the existing navigation for the original site into these "new blogs". Thought I had the solution using the WP "include it" plugin, but that didn't solve the problem. I couldn't get it to "call up" the file when I used their recommended code: [include file=filename]

That code was added to the sidebar.php template file

I was trying to "call up" the original navigation file. I tried renaming it to be a php file extension. That didn't work.

I did find a partial solution by using <?php include (navfile.php");?>
into the sidebar.php file.

I say partial, as the only way this worked was by putting a copy of "navfile" into the folder with the rest of that "newblog" files.

That means that I have to update the "navfile" with the "newblog" URL, and then will have to upload the updated "navfile" to every "newblog" folder that ends up on this site. OK when there are only a few "newblogs", but will be a pain if there are dozens, or more "new blogs".

Is there a solution that would enable me to update the "navfile", upload that file once, and have the "newblogs" access that file.

Appreciate any advice.
ByTheC
#blogs #domain #includes #multiple #multiple blogs #server #serversideincludes #side
  • Profile picture of the author GB2008
    You should be able to do this by referencing the full path to "navfile.php" - right now, your include statement assumes the same directory, but if you rewrite it as "/html/mymenu/navfile.php" or whatever your path looks like, then it should find the right place every time.
    Signature
    {{ DiscussionBoard.errors[906887].message }}

Trending Topics