|
#1
Feb 10, 2009, 01:25 AM
|
|
Hi
What are the settings in the Layout section (for Layout WIDTH and type, Layout MIN width, Layout MAX width) in order to get the header image to automatically resize according to the browser size or screen resolution?
Take a look at http://palestine-cyprus.com/
The header width is 1284px and when the screen resolution is e,g, 1024x768, it is cropped.
However the image in the post below is resized. How can I achieve this?
I have tried a number of combination for the above value without success
Any help is greatly appreciated
Thanks
|
#2
Feb 10, 2009, 09:06 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
In header.php change
PHP Code:
<!-- Header --> <td id="header" colspan="<?php echo $cols; ?>"> <?php bfa_header_config($bfa_ata_configure_header); ?>
to
PHP Code:
<!-- Header --> <td id="header" colspan="<?php echo $cols; ?>"> <a href="<?php echo get_option('home'); ?>/"><img id="headerimage" src="http://palestine-cyprus.com/wp-content/themes/atahualpa3/images/header/palestine-cyprus.jpg" alt="<?php bloginfo('name'); ?>" /></a> <?php # bfa_header_config($bfa_ata_configure_header); ?>
Still in header.php find
Code:
// with caption
$bfa("div.wp-caption").each(function() {
and add the following before it
Code:
// headerimage
var headerwidth = $bfa("td#header").width();
$bfa("#headerimage").each(function() {
var maxwidth = headerwidth + 'px';
var imgwidth = $bfa(this).width();
var imgheight = $bfa(this).height();
var newimgheight = (headerwidth / imgwidth * imgheight) + 'px';
if (imgwidth > headerwidth) {
$bfa(this).css({width: maxwidth});
$bfa(this).css({height: newimgheight});
}
});
And at HTML/CSS Inserts -> CSS Inserts put
HTML Code:
img#headerimage{
max-width: 100%;
width: auto 100%;
}
img[id~=headerimage] {
height: auto; /* hiding from IE6 */
}
|
#3
Feb 10, 2009, 11:10 AM
|
|
Thank you very much Flynn
That did the trick. However, all the code changes are in header.php (and not index.php)
I would definitely not managed alone
Thanks for the support
|
#4
Feb 10, 2009, 11:31 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Quote:
Originally Posted by yiorgos
all the code changes are in header.php (and not index.php)
|
Sorry about that, I changed it in the post above, the Javascript was also slightly wrong, it's not working in IE6 and throwing an error in IE7, it's corrected now in the post above. In header.php it should look like this now:
Code:
// without caption
$bfa(".post img").each(function() {
var maxwidth = centerwidth - 10 + 'px';
var imgwidth = $bfa(this).width();
var imgheight = $bfa(this).height();
var newimgheight = (centerwidth / imgwidth * imgheight) + 'px';
if (imgwidth > centerwidth) {
$bfa(this).css({width: maxwidth});
$bfa(this).css({height: newimgheight});
}
});
// headerimage
var headerwidth = $bfa("td#header").width();
$bfa("#headerimage").each(function() {
var maxwidth = headerwidth + 'px';
var imgwidth = $bfa(this).width();
var imgheight = $bfa(this).height();
var newimgheight = (headerwidth / imgwidth * imgheight) + 'px';
if (imgwidth > headerwidth) {
$bfa(this).css({width: maxwidth});
$bfa(this).css({height: newimgheight});
}
});
// with caption
|
#5
Feb 11, 2009, 11:54 AM
|
|
Great Flynn thanks!
I edited the code for IE as well
|
#6
Mar 8, 2009, 06:52 PM
|
|
Hey Flynn,
"And at HTML/CSS Inserts -> CSS Inserts put"
You had me right up to this point.
I've been wading through this slowly and (I hope) carefully, but this instruction threw me for a loop.
Where or what is "HTML/CSS Inserts" ?
Your help is deeply appreciated. I'd love to get my header resizing automatically....
Bill
|
#7
Mar 8, 2009, 06:57 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
It's at Wordpress Site Admin -> Appearance -> Atahualpa Theme Options -> HTML/CSS Inserts -> CSS Inserts
|
#8
Mar 8, 2009, 07:28 PM
|
|
Wow.
I didn't expect - and probably don't deserve - such fast service.
That did the trick for me - it's working great - although the blog is still only half built.
Many thanks and I hope to learn enough here to repay the favour - or at least pay it forward.
Bill
|
#9
Mar 8, 2009, 10:02 PM
|
|
Oh. I spoke too soon.
My header image is resizing, but now all my categories, pages and logo section have disappeared. The change to Header.php must have over written code for those items. I'll wade back in there to see if I can figure it out. If anyone has any ideas though, I'd appreciate them...
Bill
|
#10
Apr 3, 2009, 03:04 AM
|
|
Hey Flynn, does this step hold true my version as well (3.32 I think)?
Quote:
Still in header.php find
Code:
HTML Code:
// with caption
$bfa("div.wp-caption").each(function() {
|
I can't seem to find that code.
|
#11
Apr 4, 2009, 05:04 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Should be line 738 in header.php
|
#12
Apr 6, 2009, 10:39 AM
|
|
Great forum for this theme. Time to donate.
In the meantime, I'm not a programmer, don't know much about .php but nevertheless I need to fix my header since my webmaster is as responsive as I'd like.
How do I get at the php code to change it? Is it through the Theme Options in WP or do I need to go to my cPanel? If it's cPanel, how do I get to the code?
Thx.
|
#13
Apr 6, 2009, 12:42 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
header.php is in the theme's main directory
When uploaded it is at /wp-content/themes/[theme-name]/header.php
[theme-name] can be atahualpa, atahualpa3, atahualpa332 or similar
You'd edit header.php with a text editor such as Notepad or Notepadd++ and upload the edited version of header.php with a FTP Client software such as Filezilla to your web hosting account and overwrite the existing /wp-content/themes/[theme-name]/header.php
|
#14
Apr 6, 2009, 10:45 PM
|
|
|
26 posts · Apr 2009
Toronto, Canada
|
|
Quote:
Originally Posted by Flynn
header.php is in the theme's main directory
When uploaded it is at /wp-content/themes/[theme-name]/header.php
[theme-name] can be atahualpa, atahualpa3, atahualpa332 or similar
You'd edit header.php with a text editor such as Notepad or Notepadd++ and upload the edited version of header.php with a FTP Client software such as Filezilla to your web hosting account and overwrite the existing /wp-content/themes/[theme-name]/header.php
|
Thanks for the quick reply, Flynn. I just realized if I right click the header.php that the code will open up in cpanel. Can I just edit it there according to your post up above and save it? That way I don't need to go into Notepad.
Thx again.
|
#15
Apr 7, 2009, 05:40 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
I don't know CPanel well enough and currently don't use it but it's entirely possible that you can edit this way right on the web server in CPanel, without the need to re-upload a file that you modified on your desktop computer.
|
#16
Apr 7, 2009, 12:16 PM
|
|
Hello Flynn
How close is the above information able to assist me in making sure my site fits on all monitors (without needing to scroll from the left to the right.) - I had been informed I needed to change something from pixels to percentage. Hope you're doing well; Mark
|
#17
Apr 8, 2009, 05:24 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Atahualpa already fits into various screen sizes in its default state when you choose a fluid width layout. The header image gets cut off when required. The code above is about not cutting off but shrinking the header image instead
|
#18
Apr 10, 2009, 03:59 PM
|
|
|
26 posts · Apr 2009
Toronto, Canada
|
|
I'm still trying to re-size my header image automatically. I tried using the code above but I noticed that some of Yiorgos' code is in there too so I'm hesitant about doing just a copy 'n paste. So I'm asking questions instead of trying it out (not a programmer). Sorry.
By default, the larger headers will be cropped, correct? On the other hand, if it re-sizes automatically, does the resolution stay the same or will the header quality be affected by the re-sizing?
If the resolution stays intact, that's great.
If not, then I have to decide what the best image size would be. For example, on my widescreen laptop a 1300 pix header looks great but on my 17" desktop, it gets cropped. If I use a 970 pix header for my desktop, then it's way to small for for laptop. I guess that brings us back to auto re-sizing - as long as the quality is not affected by the re-sizing.
My WP site is at http://www.directmailinsider.com
What's the best way to go? Thanks for your help.
Rainer
P.S. You are very responsive and helpful with these posts, so it's donation time now.
|
#19
Apr 11, 2009, 06:34 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
The image resolution & quality would change. The default setting is to crop the image, with the option to choose from which end the image should be cropped, at Theme Options -> Header Image -> Header Image Alignment
|
#20
Apr 11, 2009, 12:15 PM
|
|
This worked well for me thank you VERY much!
|
#21
Apr 11, 2009, 12:35 PM
|
|
..tut mir leid! I spoke too soon. The fluid rezizing works great, but now my top page menu is gone. oops.
What did I do wrong?
Thank you
|
#22
Apr 12, 2009, 11:13 PM
|
|
|
26 posts · Apr 2009
Toronto, Canada
|
|
Thanks, Flynn. I got my header to re-size automatically. But somewhere along the way, I lost my menu bar along the top. Can you tell me how to get it back?
Thx.
Rainer
www.DirectMailInsider.com
|
#23
Apr 13, 2009, 11:10 PM
|
|
|
26 posts · Apr 2009
Toronto, Canada
|
|
Quote:
Originally Posted by Jayce
..tut mir leid! I spoke too soon. The fluid rezizing works great, but now my top page menu is gone. oops.
What did I do wrong?
Thank you
|
Looks like we have the same problem. See my post ABOVE.
Rainer
|
#24
Apr 14, 2009, 08:25 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
The solution above was geared towards a site that wasn't using anything but the header image
In header.php remove the hash # character from this line again:
PHP Code:
<?php # bfa_header_config($bfa_ata_configure_header); ?>
And at Theme Options -> Header -> Configure Header Area
remove %image
|
#25
Apr 14, 2009, 02:12 PM
|
|
|
26 posts · Apr 2009
Toronto, Canada
|
|
Thank you, Flynn. What we do without you?
Rainer
|
|