Adding different header image for each site ?
-
Hi,
I am using the Simplenotes 3.9.1 theme for many of my sites
on my multiuser network and I want to insert a header image, a different one, for each site.As this theme does not seem to have a header image does that mean
I would have to edit the templates in the theme to insert on?And if I do that doesn’t it mean that ALL my sites using that theme will have the same header image ?
Is the better option to choose a theme with a header image ?
If I do that, can I have different header images for each site ?As you can tell, I am a bit confused !!
Here is a link to my site: websitetomobilewebsite.org
Appreciate any help 🙂
.
-
If you’ve never done this before, it’s probably going to be easier to pick a theme with a customizatable header image, like TwentyEleven.
Well I do understand a bit of php but I am new to using the
Multiuser Network setup.Is what I said correct ?
As this theme does not seem to have a header image does that mean
I would have to edit the templates in the theme to insert on?And if I do that doesn’t it mean that ALL my sites using that theme will have the same header image ?
OR is there a way to store the image headers in the sites virtual directory so that “header.png” can be different for each one ?
PS. I looked at 2011 – but the place I want to put the image is right at the top, as a header image, not where they have that huge image. So I don’t thing 2011 will work for me anyway.
Thanks
OR is there a way to store the image headers in the sites virtual directory so that “header.png” can be different for each one ?
Yes, but like I said, if you’ve NEVER does this before, it’s easier to pick a theme that allows for it. The problem is that if you’re uploading the image via FTP to the blogs.dir folders, then YOU the super admin have to do it, and the user can never change it.
What you WANT is a theme that allows the users to upload their own image via theme settings. And that’s … a little complicated.
I did that today for my multisite setup. I used functions.php in a child theme to add a style tag to the head, and the CSS in the style sets a background image as title-N.png where N is the blog ID. So I have header images named title-1.png, title-2.png and so on. It’s probably not the neatest solution, but it was simple to do, it doesn’t require editing anything in the actual theme, and it works OK. If you would like more details let me know.
Rod, where are you uploading the image, though?
Sounds like the FTP will be the best route. Its my dedicated server so I can FTP as user for the main website or log in as “root” on the server to access everything.
I will go and take a look at the file structure now …
OK here is the structure looking at it through my File Manager:
http://www.sd5.info/dir.jpgMy Network is running on reviewsworthreading.com with 2 sites running under it. The user name is revworth, which is why the directory says that.
One of my sites is called: websitetomobilewebsiteorg.reviewsworthreading.com
Th directory structure does not appear to show where site images etc would be stored ( I see no hint of “websitetomobilewebsiteorg” anywhere ! )
Any help much appreciated 🙂
.
I put the images in the child theme’s directory, using FTP in the same way as Davvit plans to. Just to be clear, I don’t require end users to be able to create sites automatically on demand like WordPress.com blogs. Only I can create sites in the network, and uploading a header image is part of my manual process for creating a new site.
Only I can create sites in the network, and uploading a header image is part of my manual process for creating a new site.
Yer – same for me, I plan to use all the blogs myself.
So if I upload the images in the child theme’s directory,
I will have:
header1.jpg
header2.jpgin /home/revworth/public_html/wp-content/themes/simplenotes/images
How will I then assign:
header1.jpg to the site 1
and
header1.jpg to the site 2???
Thanks
I did that using a child theme: instructions here
In the child theme’s directory I added a new file named functions.php containing:
<?php // site title image... function ps_head () { global $blog_id; $url = content_url('themes/plainsite/title-'.$blog_id.'.png'); echo '<style type="text/css">#site-title {background: url("'.$url.'") transparent center center no-repeat;}</style>'; } add_action('wp_head', 'ps_head'); ?>My child theme is named plainsite, my images are named title-1.png etc., and I am setting the background image for the site-title heading in the parent theme Coraline. You will have to change these things to suit your requirements.
Thanks Rod for your kind assistance !
I have not used “child themes” before so will read through the info on that link and then try and apply what you have suggested.
Will post again if I get into problems.
Thanks again. 🙂
.
Hi Rod,
OK, I have tried what you suggested and I have NEARLY got it working.
I do have a question though: How does WordPress know that my site is supposed to use the child theme and not the parent theme ?
I expected to see the child theme listed in Manage Themes for the individual site – but it is not there. So how do I select it to be used ?
Thanks.
Hi Again.
OK – I forgot that I needed to Activate the child theme for the Network.
I have done that now and the child is now working 🙂
BUT the image is not there.
This is what I have done:
My file structure: http://www.sd5.info/dir1.jpg
In that new images directory, I put 2 header images:
title-1.jpg
title-2.jpgThe CSS:
/* Theme Name: Coraline Child Theme URI: http: //example.com/ Description: Child theme for the Coraline theme Author: Me Author URI: http: //example.com/about/ Template: coraline Version: 0.1.0 */ @import url("../coraline/style.css"); #site-title a { color: #009900; }The function:
<?php // site title image... function ps_head () { global $blog_id; $url = content_url('images/title-'.$blog_id.'.jpg'); echo '<style type="text/css">#site-title {background: url("'.$url.'") transparent center center no-repeat;}</style>'; } add_action('wp_head', 'ps_head'); ?>I have used the same theme you are using and the ccs
has changed the heading GREEN but the image has not changed 🙁Here is the result: my-website
Any ideas what I did wrong ?
.
How does WordPress know that my site is supposed to use the child theme and not the parent theme ?
Ah. Themes.
Go in to Network Admin -> Themes
From there, you can activate a theme to be used on all children sites.
OR go to Network Admin -> Sites -> Edit
Edit the site’s theme tab and force the theme there.
Also consider http://wpmututorials.com/how-to/change-the-default-theme-for-sites-without-a-plugin/
Basically, something like this on your config file:
define('WP_DEFAULT_THEME', 'classic');where ‘classic’ is replaced with the folder name of your theme.
Thanks.
I think our posts crossed !!
I have changed the path in the function to:
$url = content_url('http://reviewsworthreading.com/wp-content/images/title-'.$blog_id.'.jpg');as I thought it might be the reason for the image not showing.
But alas – no improvement 🙁
Could it be because I am using JPG and not a transparent png image ?
The content_url function provides the
http://reviewsworthreading.com/wp-content/part. Use either:$url = 'http://reviewsworthreading.com/wp-content/images/title-'.$blog_id.'.jpg';or:
content_url('images/title-'.$blog_id.'.jpg');
The topic ‘Adding different header image for each site ?’ is closed to new replies.