• Resolved xinfo

    (@xinfo)


    Hi

    I am trying to place the add in between the post in the index page well i found in the codex to instruction to find the

    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>

    But i am not able to find it i am using default theme

Viewing 6 replies - 1 through 6 (of 6 total)
  • That’s the Loop for earlier versions.
    Look in the Codex how does it look like in WP 2.x

    Thread Starter xinfo

    (@xinfo)

    i can able to find only this link http://codex.wordpress.org/User:Tomhanna/Adding_Ads_to_Wordpress

    but it look for older version help me to find for new version for placing ad between the post

    thanks

    your close,

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Thread Starter xinfo

    (@xinfo)

    ah i want to use this code
    <?php $postnum = 1; $showads = 5; ?>
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php the_content(); ?>
    <?php if ($postnum == $showads) { ?> <<ADD ADVERTISING HERE>> <?php } $postnum++; ?>
    <?php endforeach; else: ?>
    There are no posts!
    <?php endif; ?>

    to place the in between the post need help whn i add this code i get error

    well do i have to add above code after this code
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Thread Starter xinfo

    (@xinfo)

    Hope some one help me i able to find instruction for old version not for new version, and i don’t want to use any plugin.

    Thread Starter xinfo

    (@xinfo)

    well i solved my own question my self with the help of

    http://www.tamba2.org.uk/wordpress/adsense/

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Placing code in index.php need help’ is closed to new replies.