Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   use new header template for one page (http://forum.bytesforall.com/showthread.php?t=6681)

Stingraynut Apr 11, 2010 01:19 AM

use new header template for one page
 
I would like to make a new header template for just one page, removing the image code

I have a static page using a template and that template loads a different header template.

I would like to change the new header template to remove everything to do with the image and it's rotation. I want to style several things in the header area.

I removed <?php bfa_header_config($bfa_ata['configure_header']); ?> from the template, but of course that removed the menu as well.

Everything else is fine. What code do I need in the new header template, to get the menu reloaded?

I would like to keep the header size etc normal for other pages.


I suspect it's not as simple as that !!

Stingraynut Apr 12, 2010 06:35 PM

I have tried copying all, and parts, of the bfa_header_config.php file into my new header template- and removing the call <?php bfa_header_config($bfa_ata.... etc

but my lack of knowledge of PHP is preventing me seeing what stops it from working.

On my last try, the error message pointed to the last line of the header which is
"<!-- Main Column -->
<td id="middle">"
I think that means up to there was OK -I'm guessing that some code before that has not been finalised?

Or is there another file I need to copy into the header as well?

I would like to have the menu and the category menus displayed but leave out the rotating header on just one page - otherwise I could just eliminate the header image entirely by removing %image

Hope someone can help me here PLEASE!!

juggledad Apr 13, 2010 05:02 AM

if you want the rotating images on most pages and a single image on a particular page, just use a CSS insert for the unique page like this
HTML Code:

body.page-id-2 div#imagecontainer {
background-image: url(/wordpress/wp-content/uploads/bg.jpg) !important;
}

you might have to use the full url

Stingraynut Apr 14, 2010 05:17 PM

Thanks J, I really want to insert a div with several boxes in it -I've tried putting text box widgets there but it's not exactly what i want,I would prefer to have full control of the html/css in that area - replacing the header image with boxes, two for text, and one a slideshow.

juggledad Apr 14, 2010 07:18 PM

here is an idea, put all your code to gether and give the outermost <div id="my_imagecontainer">
put this code in the 'configre header area' option right after %image.

now add the following CSS (assuming page 2 is the page you don't want the rotating header, but want yours)
HTML Code:

body div#my_imagecontainer {display:none;}
body.page-id-2 div#imagecontainer {display:none;}
body.page-id-2 div#my_imagecontainer {display:inline;}

hopefully this will display the rotating image on all but page 2 and that is the only place my_imagecontainer will show up.

Stingraynut Apr 15, 2010 02:37 AM

Well I have got what I wanted, sorry JD I only just saw your suggestion- thanks I will have a think about it, perhaps you will comment on this 'Hammer & Chisel' approach -

ATAHUALPA - replace header image with content

create a page template by copying index.php and renaming it Front.php

Put this code at the top
<?php
/*
Template Name:Front
*/
?>



replace 'get_header(); ?>'

with


<?php include (TEMPLATEPATH . '/header_front.php'); ?>

OK , next - create a new header.php file called header_front.php from header.php


look down the code and after

<?php bfa_header_config($bfa_ata['configure_header']); ?>

insert link to content file, which can be a php call or just a link to an html file - ie



<?php include (ABSPATH.'wp-content/themes/atahualpa/newhead.htm'); ?>

or
<div class="slideright">
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
</div>


change home page to use 'Front' template

and create an html file with whatever code and content you need.

Put CSS in the Atahualpa Insert CSS section.

I have it up and running, but very experimental and way too dirty to show you!! (but I think you know the url)

tested working IE7 and FF

Is this a dirty way to do it?
When I upgrade the theme, will my files Front.php, header_front.php & newhead.htm stay or have to be re uploaded?

juggledad Apr 15, 2010 03:33 AM

yes you will have to migrate those files
p,s, I just did a quick test of my suggestion and it works like a charm

vtlock Apr 15, 2010 08:06 AM

Quote:

Originally Posted by Stingraynut (Post 29908)
<?php include (ABSPATH.'wp-content/themes/atahualpa/newhead.htm'); ?>

If I were to make a template that calls an html file to change the header image (I'd like to make different pages that look exactly like my main page--just with different header images), what HTML would need to be in the newhead.htm file?

The CSS insert method looks like an easier way of doing this, but I'll have way too many pages to add a new insert for each page created.

Stingraynut Apr 15, 2010 04:39 PM

I'm going to try JD's method today, but in case it helps, here's my entire .htm file.

It doesn't seem to matter whether there is head in it but I've left it just in case it breaks in some browser. This gives me 3 inline boxes in the header area, with the right CSS

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>

<body>

<div class="headboxcontainer">
<div class="headbox">
<div class="box1"> BOX ONE</div>

<div class="slide">
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
</div>

<div class="box2">BOX TWO</div>

</div>
</div>

</body>

</html>


The outer 'headboxcontainer' is there to push the sidebars and content down to the right position.

It's rough and ready, I'm still testing.

Stingraynut Apr 15, 2010 11:13 PM

Juggledad- you are a genius!!

Your method is way simpler!!

Is there a shortcut if I want to do that on more than one page?

juggledad Apr 16, 2010 04:46 AM

you could do this
HTML Code:

body div#my_imagecontainer {display:none;}

body.page-id-2 div#imagecontainer,
body.page-id-7 div#imagecontainer.
body.page-id-32 div#imagecontainer {
    display:none;
    }

body.page-id-2 div#my_imagecontainer,
body.page-id-7 div#my_imagecontainer,
body.page-id-32 div#my_imagecontainer {
    display:inline;
    }



All times are GMT -6. The time now is 01:35 PM.

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