1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding Ads

Discussion in 'Blogging' started by itsromanorc, Jun 16, 2016.

  1. itsromanorc

    itsromanorc Regular Member

    Joined:
    Apr 20, 2013
    Messages:
    476
    Likes Received:
    55
    I want to place some ads in between posts for example.

    Post 1

    (Ad)

    Post 2

    And so on, is there any plugin or way to do this?
     
  2. niravblogs

    niravblogs Newbie

    Joined:
    Sep 18, 2014
    Messages:
    5
    Likes Received:
    0
    Gender:
    Male
    Occupation:
    Web Developer
    How to Post in BlackhatWorld.. Can Tell Me
     
  3. Zwielicht

    Zwielicht Moderator Staff Member Moderator Jr. VIP

    Joined:
    Aug 31, 2013
    Messages:
    6,590
    Likes Received:
    11,737
    Gender:
    Male
    Occupation:
    Private Investigator
    Location:
    Riverside, California
    Home Page:
  4. itsromanorc

    itsromanorc Regular Member

    Joined:
    Apr 20, 2013
    Messages:
    476
    Likes Received:
    55
    Thanks man, will check it out
     
  5. itsromanorc

    itsromanorc Regular Member

    Joined:
    Apr 20, 2013
    Messages:
    476
    Likes Received:
    55
    i notice it only allows for inputing into post, dont really see a way to do so between posts
     
  6. Zwielicht

    Zwielicht Moderator Staff Member Moderator Jr. VIP

    Joined:
    Aug 31, 2013
    Messages:
    6,590
    Likes Received:
    11,737
    Gender:
    Male
    Occupation:
    Private Investigator
    Location:
    Riverside, California
    Home Page:
    That's the primary feature (and the one I use it for), although in version 1.1.x.x+, you should have the option for template ads.
    If anything, you can also look into using this plugin: https://wordpress.org/plugins/adrotate/

    If those plugins don't work for you at all, you should be able to just add the ad code to your index.php file like in this example I found:
    Code:
    <?php if ( have_posts() ) : ?>
    
    <?php $count = 1; ?>
    
        <?php while ( have_posts() ) : the_post(); ?>
    
            <?php get_template_part( 'content', ( post_type_supports( get_post_type(), 'post-formats' ) ? get_post_format() : get_post_type() ) ); ?>
    
            <?php if ( is_singular() ) comments_template(); // Loads the comments.php template. ?>
    
            <?php if($count == 1):?>
    
                <div class="ad-homepage">
              // Ad code goes here
                </div>
    
            <?php endif;?>
    
        <?php $count++;?>
    
        <?php endwhile; ?>
    
    <?php else : ?>
    
        <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
    
    <?php endif; ?>
     
  7. itsromanorc

    itsromanorc Regular Member

    Joined:
    Apr 20, 2013
    Messages:
    476
    Likes Received:
    55
    Perfect!

    Will try this out, thanks alot mate
     
  8. Linkzo

    Linkzo Jr. VIP Jr. VIP

    Joined:
    Jun 20, 2015
    Messages:
    991
    Likes Received:
    192
    Not a place to ask question like this,anyway you have started increasing your post count in blackhatworld :rolleyes: