• Resolved AngelikWebDesigns

    (@angelikwebdesigns)


    I was wondering how I could add an ad banner such as Google adsense into the header on the right hand side. Such as a 468 x 90 display banner would be ideal!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author nobita

    (@nobita)

    Hi AngelikWebDesigns

    For Example

    Add to functions.php first line(<?php before )

    <?php
    add_filter( 'raindrops_header_image_contents', 'my_custom_header_image_content' );
    
    function my_custom_header_image_content( $content ){
    
    return '<a style="border-radius: 50px;-moz-border-radius: 50px;-webkit-border-radius: 50px;border: 0px solid #800000;width: 100px;height: 100px;background: orange;display: table;text-align: center;margin: 28px 0;margin-left:20px;" href="https://www.tenman.info/wp3/raindrops/"><span style="display: table-cell;vertical-align: middle;text-align: center;color: #fff;font-weight: bold;font-size: 28px;">&spades;</span></a>';
    }
    ?>

    Thank you.

    Thread Starter AngelikWebDesigns

    (@angelikwebdesigns)

    Hi Nobita thanks for the response. But I think I should clarify that I am not wanting to add an image to the header.

    What I am hoping to do is to add a google adsense ad banner to the top right corner of the header. the size is 468 x 90

    I could use the shortcode [wp_ad_camp_2]

    This would display that particular banner sized correctly. I looked at the code you sent but cant figure out how to add the shortcode

    Theme Author nobita

    (@nobita)

    Please create template part file.

    name:hook-prepend-doc.php ( name is important )

    value example

    <div style="position:absolute;top:20px;left:50%;background:#fff;z-index:5;width:468px;height:90px;">
    
    <?php echo do_shortcode( $content ) ?>
    
    </div>

    is OK?

    Thread Starter AngelikWebDesigns

    (@angelikwebdesigns)

    Yes this is resolved

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to add an ad banner to header’ is closed to new replies.