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 »

Set different headers for each page


  #1  
Old Apr 30, 2009, 03:44 AM
curious
 
21 posts · Apr 2009
Hello,

can I set different headers (images-area) for each page without using a plugin?

Or otherwise can I use this plugin called "Dynamic Headers".

http://wordpress.org/extend/plugins/dynamic-headers/

My results using this plugin ended at this point:
After installing the plugIn, I paste this code "<?php show_media_header(); ?>" into the header.php.
The result is that the header-images (I added them for dynamic header in another directory (/wp-content/plugins/dynamic-headers/header-images/) are shown above the "logo" Area and the image area, and not in the "Image" area. The Image-Area leaves blank. This is not, what I want.
The order I use in my header area is " %logo" and than "%image".

greetings,

curious

Last edited by curious; Apr 30, 2009 at 01:34 PM.
  #2  
Old Apr 30, 2009, 03:07 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Remove %image from the theme settings
  #3  
Old Apr 30, 2009, 03:32 PM
curious
 
21 posts · Apr 2009
Hi flynn,

that doesn't work:-(


The choosen test-Headerimage is over the logo area again (after removing %image from the theme settings).
(as: "Bild1" in my attachment).

I want the solution like you see it on "Bild 2", with the choosen test-image inside yor headerimage- container (with the transparency left and right).

Last edited by curious; May 6, 2009 at 08:00 AM.
  #4  
Old Apr 30, 2009, 08:07 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
You should be able to do this with a CSS Insert

Look into the source for the ID and various classes that the <BODY> tag gets on every page, and use that to address the header image container for each page separately.

HTML Code:
/* default */
div.header-image-container {
background: url(/wp-content/themes/atahualpa332/images/header/image1.gif) !important;
}
/* homepage */
body#body-frontpage div.header-image-container {
background: url(/wp-content/themes/atahualpa332/images/header/image2.gif) !important;
}
/* static page or single post page with ID 106 */
body#body-page-106 div.header-image-container {
background: url(/wp-content/themes/atahualpa332/images/header/image3.gif) !important;
}
/* all archive pages for December */
body.December div.header-image-container {
background: url(/wp-content/themes/atahualpa332/images/header/image4.gif) !important;
}
If this does not overwrite the inline style that the header-image-container gets, you'd have to edit bfa_header_config.php and replace

PHP Code:
$header_image '<div class="header-image-container" style="background: url(' $selected_header_image ') ' $bfa_ata_headerimage_alignment ' no-repeat;">'
with

PHP Code:
$header_image '<div class="header-image-container">'
  #5  
Old May 1, 2009, 02:12 AM
curious
 
21 posts · Apr 2009
Hi flinn,

I'm sorry to tell...

First I dissable the Plug_In "Dynamic Headers".

Than I copy your CSS Insert (with my Page-ID's) into the style.css.
Result:The header-image area is empty.

Than, in addition I overwrite the part in the bfa_header_config.php with your code.
Result:The header-image area is empty, too.

Than I checked it out with only the modified bfa_header_config.php. Same result...

greetings,
curious
  #6  
Old May 1, 2009, 04:46 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Post or PM a URL please
  #7  
Old May 1, 2009, 08:32 AM
curious
 
21 posts · Apr 2009
hi Flynn,

sorry, i was blinded by science... uoohmp. I forgot to complete your Css-Code with the correct URL's from my images. After completing the correct URL-pathes in the style.ccs., all works really fine!

So again, thank you very much, for showing me the RIGHT solution.


greetings,

curious
  #8  
Old May 7, 2009, 09:36 AM
machepap
 
18 posts · Apr 2009
Hi,

I am having a similar issue, trying to follow along with this instruction, but I'm doing something wrong because I'm still getting a blank header image area.

Feel like taking a look? I'd greatly appreciate it.

here's the site, homepage and one other page so far.

thanks,

Amy
  #9  
Old May 7, 2009, 10:54 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
I see a header image (the same) on both of these URLs
  #10  
Old May 7, 2009, 11:08 AM
machepap
 
18 posts · Apr 2009
Yes,

Since my post, I found a mistake in the path to the images - I had "atahualpa332" (as in the example given) but my directory was just "atahualpa"

After making this change, the default/home page image is showing for all images. Perhaps I'm not naming the body id correctly for the other page in the added CSS? The path to the image is correct.
  #11  
Old May 7, 2009, 11:21 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
You don't have these body classes in your older theme version. Body classes were added in 3.3.2
  #12  
Old May 7, 2009, 11:32 AM
machepap
 
18 posts · Apr 2009
Right, sorry if I wasn't clear - I was pasting code that you had written (above in this thread) and had to remove the "332" to correct the path to the images. When I did this, the default image showed up. But, unfortunately, the image that I want for this page is showing up as the same default image, even though I've given a path to a different image for that page.

Thanks for your help!
  #13  
Old May 7, 2009, 11:36 AM
machepap
 
18 posts · Apr 2009
OH!

Just reread your response. I think I understand now - what I'm trying to do won't work with the version I am using. What do you recommend? I'm a little afraid of upgrading versions, as I've never done this before and I'm not sure what it entails. I don't need these header images to be editable. Is there a way I can hard-code the pages with my chosen images?

Thanks again!
  #14  
Old May 7, 2009, 04:54 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
1. Change in header.php

PHP Code:
<body<?php echo ($bfa_ata['html_inserts_body_tag'] != "" ' ' apply_filters(widget_text$bfa_ata['html_inserts_body_tag']) : ''); ?>>
to

PHP Code:
<body<?php bodyclasses(); ?><?php echo ($bfa_ata['html_inserts_body_tag'] != "" ' ' apply_filters(widget_text$bfa_ata['html_inserts_body_tag']) : ''); ?>>
2. In functions.php add this

PHP Code:
include_once (TEMPLATEPATH '/functions/bfa_bodyclasses.php'); 
where already a dozen or so of these lines are,

3. Create a file named bfa_bodyclasses.php with the content shown below, and upload it as /atahualpa/functions/bfa_bodyclasses.php

PHP Code:
<?php

// This adds classes to all, and an ID to most <BODY> tags
function bodyclasses() {

    global 
$post;
    
    if ( 
is_home() ) { 
        
$body_classes "body-homepage";
        if ( 
is_paged() ) {
            
$body_id "body-homepage-" $paged$body_classes .= " body-homepage-paged body-paged"
        }
        else 
            
$body_id "body-homepage"
    }
    
    if ( 
function_exists('is_front_page') ) {
        if ( 
is_front_page() ) 
            
$body_id "body-frontpage"
    }
        
    if ( 
is_page() ) 
        
$body_id "body-page-" $post->ID$body_classes .=" body-page"
        
    if ( 
is_single() ) 
        
$body_id "body-post-" $post->ID$body_classes .=" body-post"
    
    if ( 
is_category() ) {
        
$body_classes .= " category";
        if ( 
is_paged() ) {
            
$body_id "body-cat-" intvalget_query_var('cat') ) . "-" 
            
$paged$body_classes .=" body-category-paged body-paged"
        }
        else 
            
$body_id "body-cat-" intvalget_query_var('cat') ); 
    }

    if ( 
is_year() OR is_month() ) 
        
$body_classes .= " body-archive" single_month_title(' 'false);
    
    if ( 
is_search() ) 
        
$body_classes .= " body-search";
    
    if ( 
is_404() ) 
        
$body_classes .= " body-error";
    
    if ( 
is_date() ) $body_classes .= " body-date";

    if ( 
is_author() ) 
        
$body_classes .= " body-author";
    
    if ( 
function_exists('is_tag') ) {
        if ( 
is_tag() ) 
            
$body_classes .= " body-tag";
    }

    if ( 
is_page() OR is_single() ) {
        
$custom_fields get_post_custom($post->ID);
        if (
$my_custom_field $custom_fields['bfa_body_class']) {
            foreach ( 
$my_custom_field as $key => $value )
            
$body_classes .= $value";
        }
    }
    
    
$body_classes trim($body_classes);
    echo ( (
$body_id != '') ? " id=\"$body_id\"" '') . " class=\"$body_classes\"";

}
?>
  #15  
Old May 7, 2009, 05:35 PM
machepap
 
18 posts · Apr 2009
Yes!

I did exactly as you said, and it works! Fast and easy. Thank you thank you thank you.

You have saved me hours of aggravation

  #16  
Old May 20, 2009, 01:03 AM
martins
 
1 posts · May 2009
hello!
i did every thing from editing css to creating bfa_header_config.php. got pretty much the same problems like everybody else. finally it seems that it works.
problem is that nggallery flash plugin doesnt want to work together with these new features. i even cant access dashbord. i am getting following message on screen:


Warning: Cannot modify header information - headers already sent by (output started at /home/northci1/public_html/wp-content/themes/atahualpa/functions/bfa_bodyclasses.php:69) in /home/northci1/public_html/wp-includes/pluggable.php on line 850

page btw is working fine and headers are changing exactly like they should. apart from slide shows which are eternally loading.
but to access admin area and continue to work on my page i have to upload old header.php and functions.php and my different headers are lost. then i can deactivate flash plugin, but i need it too
  #17  
Old May 27, 2009, 05:30 PM
Ruzzian
 
1 posts · May 2009
I am trying to get dynamic headers to work and found this thread. Is it possible to use Dynamic Headers to make this work? I was trying to avoid coding if possible.
  #18  
Old Jun 19, 2009, 05:53 PM
tiber
 
11 posts · Jun 2009
Hello guys,

I also am looking to set 'static' headers for individual pages... we'll be using the pages to showcase specific items and would like the image to correspond with the content for that page.

That sounds fairly straightforward to me, however it seems by looking through this thread that's not exactly the case.

Being new to Wordpress (and this theme of course) I've tried to follow along in what's posted here but to no avail.

Is there a chance of getting a complete, single post of what should be done to allow for this functionality? If this post were to be targeted at the lowest level of understanding things of this nature that would be great.
This poor network guy is wading through web creation.

Thank you in advance for any light shed on this!

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cache and rotating images headers! Ponics Header configuration & styling 8 Dec 31, 2010 03:30 AM
Trying to insert 'dynamic headers' into horbar2 fruitbat Plugins & Atahualpa 17 Oct 5, 2009 07:46 AM
Warning: Cannot modify header information - headers already sent by Stepien Header configuration & styling 4 May 8, 2009 08:50 AM
Sticky Headers + Sidebar justjoolz Atahualpa 3 Wordpress theme 1 Apr 7, 2009 06:57 AM
Need help! how to set up Atahualpa theme's main page with links to pages? Marylander Excerpts, Read more, Pagination 0 Mar 18, 2009 10:17 AM


All times are GMT -6. The time now is 07:06 AM.


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