Forum Moderators: martinibuster

Message Too Old, No Replies

How do i add adsense to my WP navbar

adsense,navigation

         

bucknasty

4:53 pm on Jan 16, 2010 (gmt 0)

10+ Year Member



Problem: I am using wordpress and i'd like to insert a 728x15 link unit inside my navbar, next to my about page. Can anyone help me out with this?

Thank you

sid786

5:35 pm on Jan 16, 2010 (gmt 0)

10+ Year Member



Visit your navigation.php file and you can add it.. if you can't figure out then place the codes here :)

bucknasty

1:34 am on Jan 17, 2010 (gmt 0)

10+ Year Member



Hi sid786

I don't have a navigation.php file with the theme i'm using but I believe that this is the code for my navbar:

<div id="foxmenucontainer">
<div id="foxmenu">
<ul>
<?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
<li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
</ul>
</div>
</div>
<div class="content">

sid786

5:43 am on Jan 17, 2010 (gmt 0)

10+ Year Member



Hi.

Check out this code..

=====<div id="foxmenucontainer">
<div id="foxmenu">
<ul>
<?php if (is_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } ?>
<li class="<?php echo $highlight; ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
<!-- / Put adsense code after this line-->
</ul>
</div>
</div>
<div class="content">

========

With this code, your horizontal adsense code will be displayed next to 'home' in navbar.. I removed all other links/pages (deleted this line <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?> ) including ABOUT page link. I believe 'About' is an page (Usually it is)

If you want to include ABOUT link as well, then add your adsense code after the wp_list_pages. But, it can get messier if your weblog is of shorter width and you have too many pages.

I hope you get it. If not, let me know. I am always here to help you.

zico

9:27 am on Feb 1, 2010 (gmt 0)

10+ Year Member



Thanks, this is a valuable post for me :)