Alternate posts in WordPress

In order to put ads on my WordPress site, but only every few posts, I want to add a simple conditional to the bottom of each post, containing my ad code.

I have something like the following:

Read More
<?php if (the_ID() % 3 == 0){ ?>
ad code

<?php } ?>

But all this does is echo the id of the post…. for EVERY post!

What am I doing wrong?

Related posts

Leave a Reply

1 comment