WordPress.org

Ready to get started?Download WordPress

Forums

How to add AdSense on header (11 posts)

  1. xpid
    Member
    Posted 5 years ago #

    i need to figure out how to add AdSense ads on the header of my blog, so i could have adsense appear on the header every time i surf between pages rather than adding one on every page

    The red rectangle is for the adlinks, and the green rectangle is for the adbanner, i need to figure out on how to add them

    here's the link:
    http://img164.imageshack.us/my.php?image=screenshotqb0.png

  2. theblogdoctor
    Member
    Posted 5 years ago #

    I can help you out for free, contact me via my site if you want.

    -The Blog Doctor

  3. Shane G
    Member
    Posted 5 years ago #

    Hi,

    You just need to add your adsense code itno header.php file of current active theme. Once you add it your problem will be resolved successfully.

  4. ranyliq
    Member
    Posted 5 years ago #

    yes shane right.. edit the header.php and i suggest you to play with other script. to see the difference.

  5. Crewchief
    Member
    Posted 5 years ago #

    I have a question for ALL of those who post replies... I noticed in almost all of the replies, the assumption is that the person knows code. Virtually every answer says something to the extinct, " just need to add your adsense code itno header.php file of current active theme."

    Ok, we got that! But WHERE in the Header.php file do we add the code? You could cut down on the repetitive questions by answering the question so that a person with the same issue, like me can read the resolution without asking the same question again.

    I have the same question as, "xpid" for this Blog: http://findgenerators.net/Blog/

    However, just saying post in the Header.php does not help because it has to be placed in the right location.

  6. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    It depends on "where" in the header of your page you want the ad to appear. It is pretty easy to do like many of us have and try out a couple of places to see what works. That way you actual learn something (about code).

  7. Crewchief
    Member
    Posted 5 years ago #

    Ok, kmessinger, thanks for the response. So here is my header.php file. where would I place the code?

    I want it centered in the info bar right below the header.

    Thanks in advance for your input and help,

    JE

    <?php include (TEMPLATEPATH . "/pagefunctions.php"); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="distribution" content="global" />
    <meta name="robots" content="follow, all" />
    <meta name="language" content="en" />
    <title>

    <?php if (is_home() ) {?><?php bloginfo('description');?> | <?php bloginfo('name'); }
    elseif ( is_single() ) { ?><?php wp_title(''); ?> | <?php $cat = get_the_category(); $cat = $cat[0]; echo $cat->cat_name; ?> | <?php bloginfo('description'); }
    elseif ( is_page() ) { ?><?php wp_title(''); ?> | <?php bloginfo('description'); }
    elseif ( is_category() ) { ?><?php single_cat_title('');?> | <?php bloginfo('description'); }
    elseif ( is_archive() ) { ?><?php wp_title(''); ?> | <?php bloginfo('description'); }
    elseif ( is_search() ) { ?><?php echo $s; ?> | <?php bloginfo('description'); }
    elseif (is_tag()) {$tagTitle = preg_replace('/-/' , ' ' , $tag); echo ucwords($tagTitle); ?> | <?php $cat = get_the_category(); $cat = $cat[0]; echo $cat->cat_name; ?> | <?php bloginfo('description'); }
    else { ?><?php wp_title(''); ?> | <?php bloginfo('description'); }?>
    </title>
    <meta name="distribution" content="global" />
    <meta name="robots" content="follow, all" />
    <meta name="language" content="en" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php //comments_popup_script(); // off by default ?>
    <?php if (is_single() and ('open' == $post-> comment_status) or ('comment' == $post-> comment_type) ) { ?>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/prototype.js.php"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/effects.js.php"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/ajax_comments.js"></script>
    <?php } ?>
    <?php if (is_page() and ('open' == $post-> comment_status)) { ?>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/prototype.js.php"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/effects.js.php"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/ajax_comments.js"></script>
    <?php } ?>
    <style type="text/css" media="screen">
    <!-- @import url( <?php bloginfo('stylesheet_url'); ?> ); -->
    </style>
    <?php wp_head(); ?>
    </head>

    <body>
    <script type='text/javascript' src='http://track3.mybloglog.com/js/jsserv.php?mblID=<?php include (TEMPLATEPATH . '/id-mybloglog.php'); ?>'></script>
    <div id="wrap">
    <div id="header">
    <div id="logo" onclick="location.href='http://www.xxxxgenerators.net/Blog';" style="cursor: pointer;">

    <!-- If you want the blog title to appear automatically, delete this entire line
    <div id="blogname">
    <h1>/"><?php bloginfo('name'); ?></h1>
    <h3><?php bloginfo('description'); ?></h3>
    </div>

    If you want the blog title to appear automatically, delete this entire line -->

    </div>
    </div>
    <div class="navigation">

    • /">Home
    • <?php include (TEMPLATEPATH . '/navigation.php'); ?>

    </div>

  8. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    Sorry, no time to look at code . . . what I suggested was

    It is pretty easy to do like many of us have and try out a couple of places to see what works.

  9. BUroKHUli
    Member
    Posted 5 years ago #

    what happened to this post? is it resolved?

  10. dstechcafe
    Member
    Posted 4 years ago #

    echo '
    <table cellspacing="0" cellpadding="3" border="0" align="left" width="95%" class="tborder">
    <tr>
    <td align="center">

    ur adsense code here

    </td>
    </tr>
    </table>';

  11. dstechcafe
    Member
    Posted 4 years ago #

    put the above code anywhere on ur header.php. make sure u put it before the ?> tag

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.