Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

Different header images for MU Blogs?


  #1  
Old Jun 12, 2010, 05:06 PM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
I've got an MU installation and want different headers for each of the blogs. Is there a way to do it with Atahualpa? Right now I'm using the Atahualpa header for Main blog but on the sub-blogs I'm replacing the theme header images with the dynamic header plugin. However, that results in a really slow load. Is there a way to do it within the Atahualpa theme?

Last edited by wadams92101; Jun 14, 2010 at 02:33 PM.
  #2  
Old Jun 15, 2010, 10:38 AM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
Anyone?
  #3  
Old Jun 19, 2010, 12:06 PM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
Has everyone taken a World Cup hiatus?
  #4  
Old Jun 25, 2010, 05:02 PM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
Ok, So as to close this unanswered post, I'll assume that means its not possible.

Last edited by wadams92101; Jun 30, 2010 at 12:59 AM.
  #5  
Old Jun 26, 2010, 03:05 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what version of Atahualpa and WP?
I haven't had much reason to play with MU and don't have a test site setup
Have you tried the built in rotating headers?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Jun 27, 2010, 10:07 AM
talynndar
 
18 posts · Jun 2010
I am looking for same answer...

the built in rotating headers will give you the same headers on multiple blogs

I think the original poster and myself looking for a way to do a different header on each blog

so I have mainblog.com - that will rotate headers
and then I have jane.mainblog.com will have jane header
and then mary.mainblog.com would only have mary header

I thought maybe this could be done by uploading a maryheader.jpg in a folder called maryheader vs header and then calling the %image from that folder only or maybe calling %maryimage

so the easy fix would be uploading a few files and then editing the theme within the theme options editing in the backend of that particular blog. Any edits made in the main theme on WPMU would apply to all blogs

but am lost at where the %image is created and called on?

am happy to send paypal for help on this one
  #7  
Old Jun 30, 2010, 12:57 AM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
@talynndar - Exactly.

@Juggledad - WP 3.0; Ata 351; As said by Tal, rotating headers gives me same rotation on all blogs. I'm looking for permanent different headers on different blogs. That would make the theme really MU friendly. Maybe engineer for 352?
  #8  
Old Jul 1, 2010, 01:55 PM
johanM
 
16 posts · Jun 2010
in bfa_rotating_header_images.php, comment as in the code

Code:
// if (file_exists(ABSPATH."/wpmu-settings.php")) {
       ................
// }

//     if ( !file_exists( ABSPATH."/wpmu-settings.php" ) OR !$files ) {    
    if ( !$files ) {   // <====== change to this
            .........
    }
perhaps you need to modify .htaccess as

Code:
#upload files
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
that would be enough

Last edited by johanM; Jul 1, 2010 at 06:03 PM.
  #9  
Old Jul 5, 2010, 02:15 PM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
Thank Johan. I've been away from this thread for awhile and just saw your reply. I'll give it a try and report back.
  #10  
Old Jul 13, 2010, 08:32 AM
Aubergine's Avatar
Aubergine
 
15 posts · Sep 2009
Maryville, TN
Thanks to Johan for posting a possible fix. I made the changes to WP 3.0 MU with Atahualpa3.5.1, with an added test site on my web host. The changes did no harm to either site, but on the test blog, header images still load from the main site. I placed the header image for the test site in its files folder (not in the year/month folder). I found a place in the functions file that looks for wpmu-settings.php and changed it to ms-settings.php.

Perhaps a temporary kludge would be to install a copy of Atahualpa in the themes folder (named Atahualpa351-sitename) and use it with the added site?

Last edited by Aubergine; Jul 13, 2010 at 09:12 AM. Reason: clarification
  #11  
Old Jul 14, 2010, 04:20 AM
Aubergine's Avatar
Aubergine
 
15 posts · Sep 2009
Maryville, TN
I found a simple fix for the short-term. In CPanel, I added an images folder under the site's "files" folder. Added the desired header image to it and added an overriding style to ATO Options, Add HTML/CSS Inserts, using the !important property. It worked in FF, IE, and Chrome.

#imagecontainer.header-image-container {
background: url('<?php bloginfo('url'); ?>/files/images/filename.jpg') top left no-repeat !important;
}

Easy to change later, if Atahualpa folds in this feature in a future release, and it won't break if the same procedure is used with multiple blogs.

Last edited by Aubergine; Jul 14, 2010 at 04:21 AM. Reason: typo
  #12  
Old Jul 14, 2010, 10:08 AM
tsotsi
 
5 posts · Jun 2010
Siegburg
Thanks Aubergine!

you specify a "filename.jpg" for the headerimage. Does that mean, rotating headers are not working in this fix and you can only use one single image here?

Last edited by tsotsi; Jul 15, 2010 at 07:11 AM. Reason: typo
  #13  
Old Jul 15, 2010, 05:52 AM
Aubergine's Avatar
Aubergine
 
15 posts · Sep 2009
Maryville, TN
Yes, a single image. I'm making a site for someone who is wants one header image on each of several subdomains. In that situation, the CSS bandaid works.

Otherwise, the theme code would need to be edited to look inside the individual site folders for the array of images or look into sub-folders of the /images/header folder and use ones with a certain filename pattern. I just don't have time to mess with that, or more accurately, make a mess with that.

Since there are still WPMU sites out there, with site files in a different folder, revisions to the theme would be a little tricky, but I hope this feature will be added in the future. Atahualpa is well-suited for multisites, since it's so easy to tweak options for each site, and the new Menus work fine with it as widgets.
  #14  
Old Jul 15, 2010, 11:22 AM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
Thanks Aubergine for that solution! & BFA, I hope you guys are in the workshop to add the different rotating images for multi-site feature for a future release of your wonderful theme!
  #15  
Old Jul 15, 2010, 02:11 PM
johanM
 
16 posts · Jun 2010
Mine wp3 was upgraded from wpmu 2.9, tested it at my local computer with localhost, sub-directory configuration, I don't have any issue with this change. According to wp3, there is no need to specify the UPLOADBLOGSDIR in wp-config.php because it set automatically unless you want to change the blog dir to another relative path, and the files will be uploaded to "wp-content/bolgs.dir/<blog_id>/files/". According to ata3, your header images will need to have a prefix as atahualpa_header_; in my case, I change it to

$files = m_find_in_dir(get_option('upload_path'), 'atahualpa/header_[0-9]+\.(jpe?g|png|gif|bmp)$'); // was atahualpa_header_

and created an 'atahualpa' directory and changed the prefix to header_ under that directory, somehow, I don't think it does any matter. Don't forget your .htaccess, you will need to copy the code from dashboard's network tool setting. You should have a line as

Code:
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
One interesting thing is wp3 seems can only read files under directory /files. I had tried to create a images directory as <blog_id>/images, but images cannot be loaded from there.
  #16  
Old Jul 17, 2010, 08:28 AM
Aubergine's Avatar
Aubergine
 
15 posts · Sep 2009
Maryville, TN
wadams92101, after working with this a bit more, I decided to add all the site-specific images within the atahualpa351/images folder so that they would be available to all added sites with similar color schemes. To keep maintenance easier, I added separate folders for siteheaders, sitebackgrounds, and sitegraphics. To reference these graphics, I used 'template_directory' instead of 'url' in the CSS, so the url shown in my earlier post would become:

#imagecontainer.header-image-container {
background: url('<?php bloginfo('template_directory'); ?>/images/siteheaders/filename.jpg') top left no-repeat !important;
}

I am also going to experiment with the solution in Johan's latest post for header images that are unique to a single site. Doing it that way would be nice in situations where rotating banners are necessary, or for a small group of sites that are stylistically very different, or for those folks who host blogs for other people on their own sites and want to keep their stuff separated (especially useful when a site is deleted and you want their images to go poof).
  #17  
Old Jul 19, 2010, 04:56 PM
Aubergine's Avatar
Aubergine
 
15 posts · Sep 2009
Maryville, TN
Johan's solution works great! Since I did not upgrade from WPMU, I had to change:

ABSPATH."/wpmu-settings.php"
to
ABSPATH."/wp-includes/ms-settings.php"

where it occurs, in these Atahualpa theme files:
functions.php
bfa_header_config.php
bfa_rotating_header_images.php

I also used his suggestion to add an atahualpa folder to the wp-content/blogs.dir/[blog#]/files folder and put the files there, using the expected file names, header_1, header_2, ...

The sites that use my /images/siteheaders folder still work fine, but now I can use rotating headers as needed. Whoo hoo! Thanks again, Johan!
  #18  
Old Jul 20, 2010, 09:01 AM
johanM
 
16 posts · Jun 2010

WOW, I didn't know wpmu-setting.php were in those files. Thank you Aubergine to point it out. I now change it in all three files.

I also just learned you can also replace "if ( file_exists(ABSPATH."/wpmu-settings.php") )' line with ' if ( defined('WP_ALLOW_MULTISITE')' )",

in bfa_rotating_header_images.php: replace

Code:
   if (file_exists(ABSPATH."/wpmu-settings.php")) { 

         ################### images in WP upload folder (on WPMU)
....

   if (!file_exists(ABSPATH."/wpmu-settings.php") OR !$files ) {
....
with

Code:
      if ( defined('WP_ALLOW_MULTISITE') ) {

       include_once (TEMPLATEPATH . '/functions/bfa_m_find_in_dir.php'); // this line no need if you have changed it in ata/functions.php

       ################### images in WP upload folder (on WPMU)
.....

         if ( !defined('WP_ALLOW_MULTISITE') OR !$files ) {
...


It should work with all wp and ata3 versions and may be a better solution.


  #19  
Old Jul 20, 2010, 11:02 AM
tsotsi
 
5 posts · Jun 2010
Siegburg
Thanks Johan and Aubergine.

Does that mean now that ONLY the lines in "bfa_rotating_header_images.php" have to be changed as Johan described AND each <blog_id> has to have an /images folder where the headerimages have to be placed? If this is NOT right, could you make a step by step instruction or just verify the approach.

I am using WP 3 and Ata352
Thanks
  #20  
Old Jul 20, 2010, 05:19 PM
Aubergine's Avatar
Aubergine
 
15 posts · Sep 2009
Maryville, TN
Johan will need to answer your question about the file changes. I don't know.

What I did was make the changes in the 3 files listed in message #17.

Then I changed the line Johan mentioned in bfa_rotating_header_images.php
from this:
$files = m_find_in_dir(get_option('upload_path'), 'atahualpa_header_[0-9]+\.(jpe?g|png|gif|bmp)$');
to this:
$files = m_find_in_dir(get_option('upload_path'), 'atahualpa/header_[0-9]+\.(jpe?g|png|gif|bmp)$');

I made a new folder named "atahualpa" for my test site, which is site number 2:

blogs.dir/
2
/files
atahualpa

In the new atahualpa folder, I put header_1.jpg, header_2.jpg, header_3.jpg, header_4.jpg

Didn't have to do anything else with the site or ATO. It just worked.
  #21  
Old Jul 21, 2010, 04:19 PM
johanM
 
16 posts · Jun 2010
Quote:
ONLY the lines in "bfa_rotating_header_images.php" have to be changed as Johan described AND each <blog_id> has to have an /images folder where the headerimages have to be placed?
Hi, tsotsi, no and yes,

There is an issue that wp 3 default can only upload and read the files from blog_site_id/files, all files for multi-site enabled web and files must be under that 'files' directory

First, from Aubergine, there are 3 files will need to be modified, find them and search the lines

if (file_exists(ABSPATH."/wpmu-settings.php")), and replace or comment it out as I did, with

Code:
//    if (file_exists(ABSPATH."/wpmu-settings.php")) {
    if ( defined('WP_ALLOW_MULTISITE') ) {
after you finish editing all 3 files, you can start to upload the image files to the site directory, the wp3 upload default should be at

"path-to-web-directory/wp-content/blog.dir/<site_id>/files/" (see attached example)

Next, if you only made the change here without the changes similar to Aubergine did, you must name your image files with prefix as 'atahualpa_header_', for example, atahualpa_header_01.jpg, atahualpa_header_02.jpg.....etc.

if you want to mask the image directory and read the file from blog_url/images instead of 'files' directory, you could use rewrite rule in your .htaccess file, otherwise you can stop here and reload your web page.
Attached Thumbnails
Click image for larger version

Name:	bfa_header_img_structure.jpg
Views:	1417
Size:	3.7 KB
ID:	627  

Last edited by johanM; Jul 21, 2010 at 04:48 PM.
  #22  
Old Jul 22, 2010, 10:54 AM
tsotsi
 
5 posts · Jun 2010
Siegburg
Thanks Johan,

if I understand right what you are saying is that if I only change the lines in "bfa_rotating_header_images.php" I have to name the header picturers like "atahualpa_header_01.jpg" etc. but if I change the files Aubergine suggested as well, the name of the image files do not matter?? It just confuses me a bit.

Tsotsi
  #23  
Old Jul 22, 2010, 12:55 PM
johanM
 
16 posts · Jun 2010
Hi tsotsi

The image prefix 'atahualpa_header_' was hard coded by ata default. I recall that Flynn had answered the similar question for someone you have here. Please search it.

If you want to use the method as Aubergine and I did, you need to create that sub-directory under the 'files' directory first and then upload the image with image prefix whatever you preferred or changed, whatever method you use, the name of image is similar as image-prefix_###.jpg, png, or gif. The image-prefix are either as default 'atahualpa_header_' or anything, the ### should be 1,2,3... or 01,02,03..., or 001, 002, 003......etc.

If this is still too technical for you, you might want to consider to go to Donor section and ask someone for help to do it for you.

Last edited by johanM; Jul 22, 2010 at 01:06 PM.
  #24  
Old Jul 27, 2010, 10:30 AM
wadams92101's Avatar
wadams92101
 
46 posts · May 2010
Great thread! Thanks Talynndar, Johan, Aubergine, Tsotsi!

Last edited by wadams92101; Jul 27, 2010 at 10:44 AM.
  #25  
Old Oct 12, 2010, 11:55 AM
gmarsh
 
1 posts · Oct 2010
Thanks for this thread, it helped me out a lot.

I wanted to add that this did not work for me:
Code:
if ( defined('WP_ALLOW_MULTISITE') ) {
but this did:
Code:
if ( is_multisite() ) {
I just edited the three files and that was it. I was also able to upload the correctly named images using the wordpress Media Library and they were picked up correctly.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
WPMU search all blogs plugin billc108 Plugins & Atahualpa 3 Aug 28, 2010 04:21 AM
Multiple Blogs on One Site? gcarson Center area post/pages 1 Jul 13, 2010 05:46 PM
Header Image - 5 images in one header jkfly4 Header configuration & styling 3 Jan 4, 2010 04:57 PM
Best way to do static site with multiple blogs? (collective wisdom needed) lhanft Atahualpa 3 Wordpress theme 2 Aug 17, 2009 02:11 PM
header images PJK Header configuration & styling 1 Apr 11, 2009 05:53 PM


All times are GMT -6. The time now is 02:37 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.