logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$15
Include banner ad to the right of website logo

I want to implement a change in the header of website http://lebuzz.info.

Currently, there is only the website logo on the left hand side, between 2 menus, with a lot of free real estate on the right of it.

I wish to include a banner ad - 468x 60 px - from agency, generated by javascript - same type of thing as a google ad - at the right of the logo, nicely positioned in the remaining space.

The css for what is currently there is as follows:

/* Structure ---------------------- */
#top_stirp_in { width:980px; margin:0 auto; padding:0 10px; height:30px; }
#header { width:980px; margin:0 auto; clear:both; }
#categories_strip { width:970px; height:43px; margin:0 auto 10px auto; padding:0 5px; position:relative; z-index:100; }

#wrapper { width:980px; margin:0 auto; clear:both; }
.wrapper_bottom { padding:20px; height:100%; overflow:hidden; }

#content { width:570px; float:left; padding-left:15px; }
.index_content { width:580px !important; padding:0 !important; }

#sidebar { width:318px; float:right; padding-left:2px; padding-top:15px; }
#sidebar .sub_sidebar { width:140px; }
.sidebar_spacer { padding:0px 10px; padding-top:0; }


#footer { width:940px; margin:0 auto; padding:10px; clear:both; height:100%; overflow:hidden; }

/* header ---------------------- */
#top_stirp_in h3 { display:none; }
#categories_strip h3 { display:none; }

#header .blog-title { text-align:center; padding:40px 0 0 0; text-transform:uppercase; }
#header .blog-title a { font:bold 40px Arial, Helvetica, sans-serif; padding:0; margin:0; text-decoration:none; }
#header .blog-title a:hover{ text-decoration:none;}
#header p.blog-description { font:18px Georgia, "Times New Roman", Times, serif; margin:0; padding:3px 0 40px 0; text-align:center; }


The code relevant to that section in header.php is as follows:

<div id="header">
<?php if ( get_option('ptthemes_show_blog_title') ) { ?>
<div class="blog-title"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
</div>
<p class="blog-description">
<?php bloginfo('description'); ?>
</p>


<?php } else { ?>

<?php if ( get_option('ptthemes_header_banner_link') ) { ?>
<a href="<?php echo stripslashes(get_option('ptthemes_header_banner_link')); ?>">
<?php } else { ?>
<a href="<?php echo get_option('home'); ?>/">
<?php } ?>

<img src="<?php if ( get_option('ptthemes_logo_url') <> "" ) { echo get_option('ptthemes_logo_url'); } else { echo get_bloginfo('template_directory').'/skins/'.str_replace('.css','',get_option('ptthemes_alt_stylesheet')).'/logo.png'; } ?>" alt="<?php bloginfo('name'); ?>" /></a>
<?php } ?>



</div> <!-- header #end -->


Need the code to implement. Attached image shows desired result.

This question has been answered.

attachment image View Attachment

Benoit Bisson | 04/22/11 at 11:47pm Edit


(2) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    04/22/11
    11:55pm
    Christianto says:

    Wait a second I will code it for you..

    • 04/22/11 11:59pm

      Christianto says:

      I forgot, Where is the ads code?
      Did you want to put it directly or using admin backpanel?

    • 04/23/11 12:08am

      Christianto says:

      Please add to css files


      #header{position:relative}
      .cads{ height: 68px;position: absolute; right: 40px;top: 40px; width: 468px;}


      this is the header code, put your ads in div class 'cads'

      <div id="header">

      <?php if ( get_option('ptthemes_show_blog_title') ) { ?>

      <div class="blog-title">
      <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
      </div>

      <p class="blog-description">

      <?php bloginfo('description'); ?>

      </p>

      <?php } else { ?>

      <?php if ( get_option('ptthemes_header_banner_link') ) { ?>

      <a href="<?php echo stripslashes(get_option('ptthemes_header_banner_link')); ?>">

      <?php } else { ?>

      <a href="<?php echo get_option('home'); ?>/">

      <?php } ?>

      <img src="<?php if ( get_option('ptthemes_logo_url') <> "" ) { echo get_option('ptthemes_logo_url'); } else { echo get_bloginfo('template_directory').'/skins/'.str_replace('.css','',get_option('ptthemes_alt_stylesheet')).'/logo.png'; } ?>" alt="<?php bloginfo('name'); ?>" />

      </a>

      <?php } ?>

      <div class="cads">

      </div>

      </div> <!-- header #end -->

  • avatar
    Last edited:
    04/22/11
    11:59pm
    David Navarrete says:


    <div class="logo">
    <a href="<?php echo stripslashes(get_option('ptthemes_header_banner_link')); ?>">
    </div>
    <div class="ad_right">
    <!-- put de ad here -->
    </div>

    </div>

    put the ad before of <a>

    style.css
    #header .logo {float: left; display: inline;}
    #header .ad_right {float: right; display: inline;}

    Previous versions of this answer: 04/22/11 at 11:59pm

    • 04/23/11 12:13am

      Benoit Bisson says:

      Here is what I put up, and it doesn't show up.


      <div id="header">



      <?php if ( get_option('ptthemes_show_blog_title') ) { ?>



      <div class="blog-title"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?><script type="text/javascript">
      var advst_zoneid = 30066;
      var advst_width = 468;
      var advst_height = 60;
      var advst_border_style = "solid";
      var advst_border_color = "000000";
      var advst_title_color = "336699";
      var advst_title_bgcolor = "FFFFFF";
      var advst_text_color = "000000";
      var advst_text_bgcolor = "FFFFFF";
      var advst_url_color = "008000";
      var advst_url_bgcolor = "FFFFFF";
      var advst_page_scan = 1;
      var advst_withpos = 1;
      var advst_parrainage = "1";
      var advst_parrainage_style = "1";
      var advst_parrainage_position = "h";
      </script>
      <script type="text/javascript" src="http://ad.advertstream.com/advst_p.php"></script>
      <noscript>
      <a href="http://ad.advertstream.com/adsclick.php?what=zone:30066&inf=no&n=" target="_blank">
      <img src="http://ad.advertstream.com/ads.php?what=zone:30066&inf=no&n=" border="0" alt=""></a>
      </noscript></a>

      </div>

    • 04/23/11 12:17am

      David Navarrete says:


      <div id="header">

      <?php if ( get_option('ptthemes_show_blog_title') ) { ?>

      <div class="blog-title"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>

      </div>

      <p class="blog-description">

      <?php bloginfo('description'); ?>

      </p>





      <?php } else { ?>



      <?php if ( get_option('ptthemes_header_banner_link') ) { ?>
      <div class="logo">
      <a href="<?php echo stripslashes(get_option('ptthemes_header_banner_link')); ?>">
      </div>
      <div class="ad_right">

      <script type="text/javascript">
      var advst_zoneid = 30066;
      var advst_width = 468;
      var advst_height = 60;
      var advst_border_style = "solid";
      var advst_border_color = "000000";
      var advst_title_color = "336699";
      var advst_title_bgcolor = "FFFFFF";
      var advst_text_color = "000000";
      var advst_text_bgcolor = "FFFFFF";
      var advst_url_color = "008000";
      var advst_url_bgcolor = "FFFFFF";
      var advst_page_scan = 1;
      var advst_withpos = 1;
      var advst_parrainage = "1";
      var advst_parrainage_style = "1";
      var advst_parrainage_position = "h";
      </script>
      <script type="text/javascript" src="http://ad.advertstream.com/advst_p.php"></script>
      <noscript>
      <a href="http://ad.advertstream.com/adsclick.php?what=zone:30066&inf=no&n=" target="_blank">
      <img src="http://ad.advertstream.com/ads.php?what=zone:30066&inf=no&n=" border="0" alt=""></a>
      </noscript></a>
      </div>

      <?php } else { ?>

      <a href="<?php echo get_option('home'); ?>/">

      <?php } ?>



      <img src="<?php if ( get_option('ptthemes_logo_url') <> "" ) { echo get_option('ptthemes_logo_url'); } else { echo get_bloginfo('template_directory').'/skins/'.str_replace('.css','',get_option('ptthemes_alt_stylesheet')).'/logo.png'; } ?>" alt="<?php bloginfo('name'); ?>" /></a>

      <?php } ?>







      </div> <!-- header #end -->


      style.css
      #header .logo {float: left; display: inline;}
      #header .ad_right {float: right; display: inline;}

      and this?

    • 04/23/11 12:20am

      David Navarrete says:


      <div id="header">



      <?php if ( get_option('ptthemes_show_blog_title') ) { ?>



      <div class="blog-title"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>



      </div>



      <p class="blog-description">



      <?php bloginfo('description'); ?>



      </p>











      <?php } else { ?>







      <?php if ( get_option('ptthemes_header_banner_link') ) { ?>



      <a href="<?php echo stripslashes(get_option('ptthemes_header_banner_link')); ?>">






      <?php } else { ?>



      <a href="<?php echo get_option('home'); ?>/">



      <?php } ?>





      <div class="logo">

      <img src="<?php if ( get_option('ptthemes_logo_url') <> "" ) { echo get_option('ptthemes_logo_url'); } else { echo get_bloginfo('template_directory').'/skins/'.str_replace('.css','',get_option('ptthemes_alt_stylesheet')).'/logo.png'; } ?>" alt="<?php bloginfo('name'); ?>" /></a>
      </div>
      <div class="ad_right">



      <script type="text/javascript">

      var advst_zoneid = 30066;

      var advst_width = 468;

      var advst_height = 60;

      var advst_border_style = "solid";

      var advst_border_color = "000000";

      var advst_title_color = "336699";

      var advst_title_bgcolor = "FFFFFF";

      var advst_text_color = "000000";

      var advst_text_bgcolor = "FFFFFF";

      var advst_url_color = "008000";

      var advst_url_bgcolor = "FFFFFF";

      var advst_page_scan = 1;

      var advst_withpos = 1;

      var advst_parrainage = "1";

      var advst_parrainage_style = "1";

      var advst_parrainage_position = "h";

      </script>

      <script type="text/javascript" src="http://ad.advertstream.com/advst_p.php"></script>

      <noscript>

      <a href="http://ad.advertstream.com/adsclick.php?what=zone:30066&inf=no&n=" target="_blank">

      <img src="http://ad.advertstream.com/ads.php?what=zone:30066&inf=no&n=" border="0" alt=""></a>

      </noscript></a>

      </div>


      <?php } ?>















      </div> <!-- header #end -->




      style.css
      #header .logo {float: left; display: inline;}
      #header .ad_right {float: right; display: inline;}

      sorry put wrong the code

    • 04/23/11 12:24am

      Benoit Bisson says:

      Add seems to display, at least part. I'll try throwing a default one in case it's the adserver not feeding anything under the affiliate header. But look at the top bar. I't been thrown off to the sides.

    • 04/23/11 12:34am

      David Navarrete says:

      you can leave the ad five mins to develop a solution?

    • 04/23/11 12:37am

      Benoit Bisson says:

      I'm leaving it there so you (David) have time to work on a solution. Ad need to be a bit lower (vertically centered in the 143 px space) and top bar needs to get realigned properly.

    • 04/23/11 12:44am

      Benoit Bisson says:

      OK, adserver is now feeding the ad, so we know that part works. What's left is positioning and fixing the topmost menu bar back in position.

    • 04/23/11 12:46am

      Benoit Bisson says:

      Top strip fixed. Was my bad in a copy/paste.

      Any way to lower the ad though?

    • 04/23/11 12:50am

      David Navarrete says:



      <style type="text/css" media="screen">
      #header {position: relative;height: 143px;}

      #header .ad_right {position: absolute;right: 0;top: 40px;height: 60px;width: 468px;}
      #header .logo a {position: absolute;left: 0;top: 0;}

      </style>


      <div id="header">
      <?php if ( get_option('ptthemes_show_blog_title') ) { ?>
      <div class="blog-title">
      <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
      </div>
      <p class="blog-description">
      <?php bloginfo('description'); ?>
      </p>
      <?php } else { ?>
      <?php if ( get_option('ptthemes_header_banner_link') ) { ?>
      <a href="<?php echo stripslashes(get_option('ptthemes_header_banner_link')); ?>">
      <?php } else { ?>
      <a href="<?php echo get_option('home'); ?>/">
      <?php } ?>
      <div class="logo">
      <img src="<?php if ( get_option('ptthemes_logo_url') <> "" ) { echo get_option('ptthemes_logo_url'); } else { echo get_bloginfo('template_directory').'/skins/'.str_replace('.css','',get_option('ptthemes_alt_stylesheet')).'/logo.png'; } ?>" alt="<?php bloginfo('name'); ?>" /></a>

      </div>
      <div class="ad_right">
      <script type="text/javascript">
      var advst_zoneid = 30066;
      var advst_width = 468;
      var advst_height = 60;
      var advst_border_style = "solid";
      var advst_border_color = "000000";
      var advst_title_color = "336699";
      var advst_title_bgcolor = "FFFFFF";
      var advst_text_color = "000000";
      var advst_text_bgcolor = "FFFFFF";
      var advst_url_color = "008000";
      var advst_url_bgcolor = "FFFFFF";
      var advst_page_scan = 1;
      var advst_withpos = 1;
      var advst_parrainage = "1";
      var advst_parrainage_style = "1";
      var advst_parrainage_position = "h";
      </script>
      <script type="text/javascript" src="http://ad.advertstream.com/advst_p.php"></script>
      <noscript>
      <a href="http://ad.advertstream.com/adsclick.php?what=zone:30066&inf=no&n=" target="_blank">
      <img src="http://ad.advertstream.com/ads.php?what=zone:30066&inf=no&n=" border="0" alt="">
      </a>
      </noscript></a>
      </div>
      <?php } ?>
      </div> <!-- header #end -->


      final code.
      try this

    • 04/23/11 12:57am

      David Navarrete says:

      the css, you must ADD no replace.

    • 04/23/11 1:01am

      David Navarrete says:


      <style type="text/css" media="screen">

      #header {position: relative;height: 143px;margin: 0 auto; width: 980px;}



      #header .ad_right {position: absolute;right: 0;top: 40px;height: 60px;width: 468px;}

      #header .logo a {position: absolute;left: 0;top: 0;}



      </style>

    • 04/23/11 1:04am

      Benoit Bisson says:

      Perfect. Thank you David!

This question has expired.



Christianto had additional discourse to offer.

Benoit Bisson voted on this question.



Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.