WordPress Atahualpa Theme – Different Header Images for MultiSite WP

with 2 Comments

My goal was to add different header images to different sites using the Atahualpa. I expect to upload these images via FTP. I am not trying to upload these like TwentyTen does so it can be used on WordPress.com. I have a couple dozen sites and uploading the headers with FTP suits me fine. The Atahualpa Theme was designed to upload header files via FTP.

My last post, Preventing WordPress Automatic Updates From Deleting Custom Settings (Themes and Plugins) I dealt with how to protect your custom files and gave an example using the Constructor Theme.

A day later I realized that Constructor could not send out CSS if the defaults for the domain did not point to WordPress. In other words, if when you just type the domain name into the browser, it does not go to WordPress. I have some sites that the default is owned by a different program and WordPress is started in the /biog/ directory. In that case no CSS was reaching the browser… Not a pretty site!

For Newer Easier Instructions Follow This Link…

http://alantait.net/2011/01/15/wordpress-multisite-wp-multi-network-atahualpa-theme-easy-header-images/

So I went looking again and found Atahualpa 3.6.1.

The problem with Atahualpa was that it was really written for single site WordPress and the old MU. Not WP3.x It has no provision for different header images in WordPress 3.x in MultiSite Mode.

FYI – I am running Version 3.0.4 of WordPress, in MultiSite, with the WP Multi-Network plugin…

The Default Location

First I needed to find the code that got the Header files from the default location. I found the location easy enough…
wp-content/themes/atahualpa/images/header

It says that is where you should FTP the header images to. Two problems, first that directory is deleted each time Atahualpa is automatically updated. Second, I knew I needed someway to identify each header for each site.

The Program

The program code for this is…
wp-content/themes/atahualpa/functions/bfa_rotating_header_images.php

About line 28 you will find these two lines of code…

$imgpath = TEMPLATEPATH . '/images/header/';
$imgdir = $templateURI . '/images/header/';

I replace those two lines of code with this small program…

For Newer Easier Instructions Follow This Link…

http://alantait.net/2011/01/15/wordpress-multisite-wp-multi-network-atahualpa-theme-easy-header-images/

// This was removed because the newer version is smaller, faster and more reliable.
// Please use the above link and follow the instructions on the new page.  Thanks, LAN

Where do you put the header images?

So after you make that one change and upload the file, all you need to do is create the directory and upload your images. The question is, where and what name?

Multi-Site Sub-Directory

Lets say your WordPress is a MultiSite that uses sub-directories. For example:

  1. example.com/blog-1/
  2. www.example.com/blog-2/
  3. example.com/site3/

Just change the dots (.) and slashes (/) (but no end slash) to dashes (-) and lose any www at the beginning. You would simply upload your header image files to the respective directories, for example.

  1. wp-content/blogs.dir/examplecom-blog-1
  2. wp-content/blogs.dir/examplecom-blog-2 (the www is gone!)
  3. wp-content/blogs.dir/examplecom-site3

dots not dashes!

  1. wp-content/blogs.dir/example.com-blog-1
  2. wp-content/blogs.dir/example.com-blog-2 (the www is gone!)
  3. wp-content/blogs.dir/example.com-site3

Multi-Site Sub-Domain

Using Multi-Site in Sub-Domain mode, you use your domain name, without the www, and change the dots (.) into dashes (-)
For each of these sub-domains…

  1. example.com
  2. www.example.com (note that www will be removed)
  3. peter.example.com
  4. paul.example.com
  5. mary.example.com

You would upload to these directories respectively…

  1. wp-content/blogs.dir/examplecom
  2. wp-content/blogs.dir/examplecom (note that www is removed)
  3. wp-content/blogs.dir/peterexamplecom
  4. wp-content/blogs.dir/paulexamplecom
  5. wp-content/blogs.dir/maryexamplecom

dots not dashes!

  1. wp-content/blogs.dir/example.com
  2. wp-content/blogs.dir/example.com (note that www is removed)
  3. wp-content/blogs.dir/peter.example.com
  4. wp-content/blogs.dir/paul.example.com
  5. wp-content/blogs.dir/mary.example.com

Multi-Site ~ Sub-Domain ~ Multi-Network plugin…

Multi-Network directories are exactly the same as the Multi-Site Sub-Domain. Here is an example.

The Multi-Network plugin allows you to do multi site / sub-domain across different domains, here called networks. Here is a real world example This site is running on.

  1. http://alantait.net/ or http://www.alantait.net/ ~~~ aLAN Tait Net Work!
  2. http://bmfg.net/blog/ ~~~ Business Men’s Fellowship Global
  3. http://acts-29.net/ or http://www.acts-29.net/ ~~~ ACTS-29 Network
  4. http://franciskong.acts-29.net/ ~~~ Francis Kong
  5. http://fgbmfi.net/blog/ ~~~ FGBMFI Networking!
  6. http://newliphe.org/ ~~~ New LipHe / New Life
  7. http://gamot.net/blog/ ~~~ Gamot Domain Names
  8. http://alantait.com/ ~~~ aLan Tait Live!
  9. http://ofws.net/ ~~~ Overseas Filipino Workers Network
  10. http://filipina.fil.net/blog/ or http://www.filipina.fil.net/blog/ ~~~ Filipina

Note that in every case the www is removed when making a directory. Likewise, each directory is created out of the unique domain name as is a part of the Multi-Network Sub-Domain

Migrating Note: At this time I am still migrating these development sites to Atahualpa. The following are working on Atahualpa at the time of this writing…
Filipina
is working in the default image file mode.
aLAN Tait Net Work!
is working in the custom image file mode.

  1. wp-content/blogs.dir/alantait-net
  2. wp-content/blogs.dir/bmfg-net
  3. wp-content/blogs.dir/acts-29-net
  4. wp-content/blogs.dir/franciskong-acts-29-net
  5. wp-content/blogs.dir/fgbmfi-net
  6. wp-content/blogs.dir/newliphe-org
  7. wp-content/blogs.dir/gamot-net
  8. wp-content/blogs.dir/alantait-com
  9. wp-content/blogs.dir/ofws-net
  10. wp-content/blogs.dir/filipina-fil-net

dots not dashes!

  1. wp-content/blogs.dir/alantait.net
  2. wp-content/blogs.dir/bmfg.net
  3. wp-content/blogs.dir/acts-29.net
  4. wp-content/blogs.dir/franciskong.acts-29.net
  5. wp-content/blogs.dir/fgbmfi.net
  6. wp-content/blogs.dir/newliphe.org
  7. wp-content/blogs.dir/gamot.net
  8. wp-content/blogs.dir/alantait.com
  9. wp-content/blogs.dir/ofws.net
  10. wp-content/blogs.dir/filipina.fil.net

If the theme author wishes to write a program to upload header images from the wp-admin pages (in a way like TwentyTen), the wp_upload_dir() function could be used and line 21 uncommented.

However, this works just fine for FTP and that is all I needed!

Codifically,

LAN Tait

2 Responses

  1. Excel Help
    | Reply

    Cheers for the guide. Any ideas where I can get any 1300 px wifth headers for atahualpa?

    • Lan
      | Reply

      You can Google for stock photos, look for panoramic views. Then use a program like GIMP. You can also take a higher resolution photo and resize it, then cut a strip as needed. The above are actually the heading from the 2010 WP Theme, I just stretched them to 1300px. It works for most nature scenes because you do not notice the distortion. I used the program GIMP running in Ubuntu to make the above headers.

      Likewise, you could take two or more images and combine them together in GIMP. I am not saying GIMP does everything, but for making headers it does enough!

      Hey, I looked at your excel project. Those of you still using Windows (who haven’t made the move to Ubuntu yet) might find some useful tips on this site.

Leave a Reply