How 2 include a banner in header file


Author Message
RoBiNs

Posted: 7/16/2009
Quote message 

i know its not realy a atristeer problem
but i have searched for a few days for how to do this
and every reply online is for a theme thats already
there, not for adding in to any theme...

so i need to / want to use a

<?php include('adverts.php'); ?>

that will have a set number of rotating adverts in the adverts.php file
(this i have already made and works as it should do)

the image adverts are 468x60 banners and do work when included
almost anywhere in the theme i want them but i have no idea
how to set it to include in the header aligned to the right OR left with padding

hope this is understanable
 
Bud

Posted: 7/16/2009
Quote message 

I've used the following code on several themes and it works fine...

Edit header.php and add the new DIV (see comments)

<div class="Header">     <div class="Header-jpeg"></div> <div class="logo">     <h1 id="name-text" class="logo-name">         <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>     <div id="slogan-text" class="logo-text">         <?php bloginfo('description'); ?></div> </div> <!-- End of logo --> 	<!-- Beginning of header ad block --> 	<div class="headerad"> 		<?php include('adverts.php'); ?> 	</div> 	<!-- End of header ad block --> </div><!-- End of Header -->


Then add this piece of CSS to the style.css file...

.header-ad	{ float:left; margin-top:35px; margin-right:10px; margin-bottom:0; margin-left:516px; height:70px; }


I'm sure there are better ways but this works. I found it in another theme and adapted to mine.
 
Bud

Posted: 7/16/2009
Quote message 

Let's try it without this forums stupid limitations...

I've used the following code on several themes and it works fine...

Edit header.php and add the new DIV (see comments)

<div class="Header">
<div class="Header-jpeg"></div>
<div class="logo">
<h1 id="name-text" class="logo-name">
<a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div id="slogan-text" class="logo-text">
<?php bloginfo('description'); ?></div>
</div> <!-- End of logo -->
<!-- Beginning of header ad block -->
<div class="headerad">
<?php include('adverts.php'); ?>
</div>
<!-- End of header ad block -->
</div><!-- End of Header -->



Posted: 7/16/2009
Quote message

I've used the following code on several themes and it works fine...

Edit header.php and add the new DIV (see comments)

<div class="Header"> <div class="Header-jpeg"></div> <div class="logo"> <h1 id="name-text" class="logo-name"> <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1> <div id="slogan-text" class="logo-text"> <?php bloginfo('description'); ?></div> </div> <!-- End of logo --> <!-- Beginning of header ad block --> <div class="headerad"> <?php include('adverts.php'); ?> </div> <!-- End of header ad block --> </div><!-- End of Header -->



Then add this piece of CSS to the style.css file...

.header-ad {
float:left;
margin-top:35px;
margin-right:10px;
margin-bottom:0;
margin-left:516px;
height:70px;
}

I hope this looks better

Bud
budstechshed.com
 
RoBiNs

Posted: 7/16/2009
Quote message 

thanks for that..
just need to tweek it to get it working.

as i have tryed 4 different banner rotate scripts and they
all show the banners ok on random but none are clickable.
when the css style is added
as soon as i remove

.header-ad {
float:right;
margin-top:30px;
margin-right:20px;
margin-bottom:20;
height:68px;
}

from the style sheet and the banners default to the top
left of the header they become clickable again.
and work great but as soon as the style is added back
to the style sheet they go back in line where i want them
but are not clickable anymore
 
Bud

Posted: 7/16/2009
Quote message 

I forgot, you need to reduce the size of the .logoDIV. It's sitting on top of your add and preventing it from being clicked.

Find this in your style.css...

.logo {
display:block;
left:30px;
position:absolute;
top:29px;
width:470px; <!-- play with this value -->
}
 
RoBiNs

Posted: 7/17/2009
Quote message 

Thanks,,

never needed to know much css untill now
so i will be learning it..

thanks for the help.....