WordPress.org

Ready to get started?Download WordPress

Forums

Insert Google Ads in the first post only (3 posts)

  1. irvrobinson
    Member
    Posted 7 years ago #

    I'm trying to insert some Google Ads in the first post only. I know how to insert it in all of them, but I would like to show it only in the first one. Is it possible?

    Here is a link with the same theme I have

    Link

    Thank you

  2. Marcel Brinkkemper
    Member
    Posted 7 years ago #

    you can check for first post with php statement

    <?php if(is_home() && $post==$posts[0]): ?>
    ... your google add stuff ...
    <?php endif ?>
  3. horatiub
    Member
    Posted 7 years ago #

    that should work

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags