Results 1 to 13 of 13

Thread: How To: Put banner in between Wordpress post

  1. #1
    Join Date
    Oct 2006
    Location
    Malaysia
    Posts
    65
    Rep Power
    156

    How To: Put banner in between Wordpress post

    I've still not found the answer for this. Well, I have but it's only for WP 1.5 and not 2.0+.

    How do I insert a banner/Adsense in between my 1st and 2nd post on the Index Template?

    Currently, my code is like this:
    PHP Code:
    <div id="content">
        <?php if (have_posts()) :?>
            <?php $postCount=0?>
            <?php while (have_posts()) : the_post();?>
                <?php $postCount++;?>
        <div class="entry entry-<?php echo $postCount ;?>">
            <div class="entrytitle">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> 
                <h3><?php the_time('F jS, Y'?></h3>
            </div>
            <div class="entrybody">
    <?php the_content('<p>Read the rest of this entry &raquo;</p>'); ?>
            </div>
            
            <div class="entrymeta">
            <div class="postinfo">
                <span class="postedby">Posted by <?php the_author() ?></span>
                <span class="filedto">Filed in <?php the_category(', '?><?php edit_post_link('Edit'' | '''); ?></span>
    <?php comments_popup_link('No Comments »''1 Comment »''% Comments »''commentslink'); ?> | <?php if(function_exists('the_views')) { the_views(); } ?>
    <script src="http://feeds.feedburner.com/~s/WebsitesMadeSimple?i=<?php the_permalink() ?>" type="text/javascript" charset="utf-8"></script>
            </div>
            </div>
            
        </div>
        <div class="commentsblock">
            <?php comments_template(); ?>
        </div>
        <?php endwhile; ?>

    <?php next_posts_link('&laquo; Previous Entries'?> | <?php previous_posts_link('Next Entries &raquo;'?>

            
        <?php else : ?>

            <h2>Not Found</h2>
            <div class="entrybody">Sorry, but you are looking for something that isn't here.
    </div>
        <?php endif; ?>
    </div>
    Hope someone could help me out with this.

    Thanks.
    Websites Made Simple is my Malaysia website design blog.

  2. #2
    Join Date
    Jul 2006
    Location
    Penang
    Posts
    1,781
    Rep Power
    10
    Put the code before the looping ends:

    PHP Code:
        <?php endwhile; ?>

  3. #3
    Join Date
    Oct 2006
    Location
    Malaysia
    Posts
    65
    Rep Power
    156
    Urm, it works but it's being repeated in the middle of all my posts.

    I want it to only appear between the 1st and 2nd recent post.

    Thanks.
    Websites Made Simple is my Malaysia website design blog.

  4. #4
    Join Date
    Oct 2006
    Location
    Malaysia
    Posts
    65
    Rep Power
    156
    Websites Made Simple is my Malaysia website design blog.

  5. #5
    Join Date
    Jul 2006
    Location
    Penang
    Posts
    1,781
    Rep Power
    10
    Quote Originally Posted by dannyfoo View Post
    Ah, that solves it. Thanks for sharing.

  6. #6
    Join Date
    Jan 2007
    Location
    Ampang, KL
    Posts
    32
    Rep Power
    0

    Question How about Blogs hosted at WordPress.com?

    have anyone experienced inserting adsense banner in a blog post that is hosted at WordPress.com?
    Coder's Talk | Art Of ApOgEE | (coming soon... )

  7. #7
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    275
    Quote Originally Posted by ApOgEE View Post
    have anyone experienced inserting adsense banner in a blog post that is hosted at WordPress.com?
    Wordpress.com TOS said, they not allow any ads in their blog service. Some people banned/suspended due promoting AFFILIATE and REFERAL program .

    So!.. easy.. get your own domain and hosting

  8. #8
    Join Date
    Jul 2006
    Location
    My
    Posts
    967
    Rep Power
    0
    you could switch to blogger.com instead

  9. #9
    Join Date
    Jan 2007
    Location
    Ampang, KL
    Posts
    32
    Rep Power
    0
    yeah... i got it!! thanks everybody... i think now i have to switch to paid hosting... no hanky panky... and i can start learning straight away...
    Coder's Talk | Art Of ApOgEE | (coming soon... )

  10. #10
    Join Date
    Oct 2006
    Location
    Malaysia
    Posts
    65
    Rep Power
    156
    LoL! well, it ain't that expensive to get a reliable, professional, performing paid hosting plan today.
    Websites Made Simple is my Malaysia website design blog.

  11. #11
    Join Date
    Jan 2007
    Location
    Surabaya
    Posts
    11
    Rep Power
    0
    if you want to use wordpress for test only, you may use 110mb.com.
    you'll get 2 gigs space. I usually use this hosting for a testing server.
    uload your zip there and extract. it's easy.

  12. #12
    Join Date
    Nov 2006
    Location
    PeNaNG - JB
    Posts
    183
    Rep Power
    157
    danny i still cant find way around to play with k2 theme.. they said its gotta be somewhere 'the_loop'...

    give it some rest...

  13. #13
    Join Date
    Oct 2006
    Location
    Malaysia
    Posts
    65
    Rep Power
    156
    urm.. I'll try to find the file buchin was mentioning about when I temporarily use the k2 theme again...or install another WP somewhere on my server. :P

    Hopefully can get it out this coming week.

    Cheers.
    Websites Made Simple is my Malaysia website design blog.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Banner Script
    By calvynlee in forum Website Programming
    Replies: 2
    Last Post: 26-01-2008, 01:50 AM
  2. Banner Ads
    By Gordon in forum Revenue and Monetization
    Replies: 4
    Last Post: 02-07-2007, 11:08 PM
  3. Banner creator
    By liewss80 in forum Webmaster Tools
    Replies: 6
    Last Post: 23-04-2007, 03:20 PM
  4. Banner Exchange
    By FarinaRacer in forum Site, Domains and Links Marketplace
    Replies: 0
    Last Post: 13-02-2007, 10:01 AM
  5. Free banner
    By bardshah92 in forum Search Engine Marketing
    Replies: 0
    Last Post: 14-01-2006, 03:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39