Ads on Blog

Status
Not open for further replies.

Grandcruiser

New Member
Messages
155
Reaction score
0
Points
0
Hey can anyone tell me how to add ads to my blog?I'm using WordPress with the Connections theme.
 
Last edited:

lambada

New Member
Messages
2,444
Reaction score
0
Points
0
A quick Google:
Ads in the Header

Some Themes will allow you to place ads (or anything) in the header template file easily. The ads are added to the header.php template file. If your Theme creates the header using a <div> or <span>, you can usually place your ad code inside that and have it appear in the header. In the following example, the ad will appear just under your blog name:

<h1 id="header">
<a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a>
<<ADD ADVERTISING HERE>>
</h1>

Other Themes, often based on the Default WordPress Theme, create the header by assigning the header class/id to a headline tag that is wrapped around the title. If your Theme does that, you will likely need to place the advertising code below the Header in the content or comparable section.

<div id="header">
<div id="headerimg">
<h1>
<a href="<?php echo get_settings('home'); ?>">
<?php bloginfo('name'); ?></a>
</h1>
<div class="description">
<?php bloginfo('description'); ?>
</div>
</div>
</div>
<div id="content">
<<ADD ADVERTISING HERE>>

Play around with the placement to get it in the appropriate place dependent upon your header design and layout. Be sure and validate your page afterwards to ensure the placement works.
[edit]
Ads in The Sidebar

You can add ads to the sidebar by editing the sidebar.php template file. The standard WordPress sidebar template file features a complex nested list, so take care not to disturb the nest. You can carefully integrate ads into the list, or restructure the list to remove the nesting feature if the ad's code interupts the list format. Or add the ads to the top or bottom of the nested list, skipping any possible coding conflicts. To include the code inside of the list, you may need to put your advertisers code between a pair of <li> </li> tags or your page will not validate and may not look right. For example, you may want to include an ad between the Pages and Archives in your sidebar:

<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
<li><<ADD ADVERTISING HERE>></li>
<li><h2>Archives</h2>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>
Source: http://codex.wordpress.org/User:Tomhanna/Adding_Ads_to_Wordpress
That should help, if not feel free to post back, and i'll try to assist you more.
 
Status
Not open for further replies.
Top