How can i put Ads between posts in iBlog Pro 3?
#1
Posted 03 December 2009 - 10:14 AM
I would like to know how I can add some Tradedoubler-ads to the space between my blogposts in iBlog Pro (www.skrufve.se). Is there anyway to put a widget there?
I really would like to have an easy changeable box (since I need to change the current ad every now and then). And I would like it to always come after the first blog post. eg:
[Latest blogpost]
[Tradedoubler ad - fixed position in the listing]
[Second most latest blogpost]
[more blog posts.....]
Anyone who know how I could do this?
#2
Posted 03 December 2009 - 05:56 PM
#3
Posted 03 December 2009 - 07:40 PM
#4
Posted 03 December 2009 - 08:06 PM
#5
Posted 03 December 2009 - 09:41 PM
This is what I should find:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!-- do stuff -->
<?php endwhile; ?>
<?php endif; ?>
And replace with:
<?php
$postcounter = 1; // set counter to 1 for ads
if (have_posts()) : ?>
<?php while (have_posts()) : $postcounter = $postcounter + 1;
the_post(); ?>
<!-- do stuff -->
<?php if(2 == $postcounter) {
echo
'
<div id="adsbetween">
<-- Place ad code here -->
</div>
'
; } ?>
<?php endwhile; ?>
<?php endif; ?>
The most similar I can find (I'm not that good at this
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="postwrap fix">
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="copy fix">
<?php if(is_single() && pagelines('excerptshidesingle')):?>
<?php else: ?>
<?php $postimageurl = get_post_meta($post->ID, 'thumb', true); if ($postimageurl) { ?>
<div class="thumb left">
" rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>">
" alt="Post Pic" width="200" height="200" />
</div>
<?php } ?>
<?php endif;?>
Is this correct - and if so - where should I insert that code?
#6
Posted 03 December 2009 - 09:43 PM
#7
Posted 03 December 2009 - 09:57 PM
Could you help me how could I use that code to place an ad between the first and second post on the "Blog" page in iBlog Pro 3.
is this right?
<?php
$postcounter = 1; // set counter to 1 for ads
if (have_posts()) : ?>
<?php while (have_posts()) : $postcounter = $postcounter + 1;
the_post(); ?>
<!-- do stuff -->
<?php if(2 == $postcounter) {
echo
'
<div id="adsbetween">
<-- Place ad code here -->
</div>
'
; } ?>
<?php endwhile; ?>
<div class="postwrap fix">
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="copy fix">
<?php if(is_single() && pagelines('excerptshidesingle')):?>
<?php else: ?>
<?php $postimageurl = get_post_meta($post->ID, 'thumb', true); if ($postimageurl) { ?>
<div class="thumb left">
" rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>">
" alt="Post Pic" width="200" height="200" />
</div>
<?php } ?>
<?php endif;?>
or should I do like this:
<?php if(is_home()):?>
<?php
$postcounter = 1; // set counter to 1 for ads
if (have_posts()) : ?>
<?php while (have_posts()) : $postcounter = $postcounter + 1;
the_post(); ?>
<!-- do stuff -->
<?php if(2 == $postcounter) {
echo
'
<div id="adsbetween">
<-- Place ad code here -->
</div>
'
; } ?>
<?php endwhile; ?>
<?php endif;?>
<div class="postwrap fix">
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="copy fix">
<?php if(is_single() && pagelines('excerptshidesingle')):?>
<?php else: ?>
<?php $postimageurl = get_post_meta($post->ID, 'thumb', true); if ($postimageurl) { ?>
<div class="thumb left">
" rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>">
" alt="Post Pic" width="200" height="200" />
</div>
<?php } ?>
<?php endif;?>
#8
Posted 03 December 2009 - 11:06 PM
"All life is an experiment. The more experiments you make the better." - Ralph Waldo Emerson
I'd just keep fiddling with it until you get what you want. I don't think you can have two 'loops' on the same page however.
You would have to use this type of command instead:
`$myposts = get_posts('numberposts=(number of posts to show)&offset=(offset of first post)');`
#9
Posted 03 December 2009 - 11:06 PM
"All life is an experiment. The more experiments you make the better." - Ralph Waldo Emerson
I'd just keep fiddling with it until you get what you want. I don't think you can have two 'loops' on the same page however.
You would have to use this type of command instead:
`$myposts = get_posts('numberposts=(number of posts to show)&offset=(offset of first post)');`
#10
Posted 03 December 2009 - 11:20 PM
#11
Posted 04 December 2009 - 12:14 AM










