WordPress.org

Ready to get started?Download WordPress

Forums

Add an Ad to the left of every post, without sidebar (2 posts)

  1. TheFlyingDutchman17
    Member
    Posted 9 months ago #

    Hello,

    I'm trying to add an advertisement (Adsense) to my site.
    I want to put it on the left side of every post, in my theme there is no possibility to add a sidebar to the left (maybe there is, but I don't know how, and I've tried it quite a lot already....)

    Ad size: 120*600
    Theme: UberPic
    My website: http://www.funover9000.com

    Here is the code of my "single post" (single.php). I think I have to put the advertisement somewhere there... I just have no idea at all how (I don't know anything about HTML/code). By the way: I have one advertisement put in/beneath the header already, I just don't know how to put it on the left side of every single post...

    <?php get_header(); ?>
    
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-9015800011495913";
    /* 1 Top Leaderboard */
    google_ad_slot = "1026233779";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="//pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
    <div class="eleven columns ">
    <div id="content" >
    
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <article class="post" id="post-<?php the_ID(); ?>">
    
    <div class="title">
    
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    </div>
    
    <div class="entry">
    
    		<div id="newprevbutton" style="float:left">
            <?php previous_post_link('%link','<img id="newprevbutton" src = "http://mythemeslab.com/images/uberpic/new_prev.png">'); ?></a>
    		</div>
    
    		<div id="newnextbutton" style="float:right;" >
            <?php next_post_link('%link','<img id="newnextbutton" src = "http://mythemeslab.com/images/uberpic/new_next.png">'); ?></a>
    		</div>
    <?php the_content('Read the rest of this entry ยป'); ?>
    <div class="clear"></div>
    <?php wp_link_pages(array('before' => '<p><strong>Pages: </strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    </div>
    
    <hr class="remove-bottom">
    		<div id="prevbutton1" style="float:left">
            <?php previous_post_link('%link','<img id="blueprevious" src = "http://mythemeslab.com/images/uberpic/page_prev.png" style="margin:0;">'); ?></a>
    		</div>
    
    		<div class="random" style="float:left">
    		<a href="<?php bloginfo('siteurl');?>/index.php?random=1" border="0"><img src="http://mythemeslab.com/images/uberpic/page_random.png" alt="Random Image" /></a>
    		</div>
    
    		<div id="nextbutton1" style="float:right;" >
            <?php next_post_link('%link','<img id="blueprevious" src = "http://mythemeslab.com/images/uberpic/page_next.png" style="margin:0;">'); ?></a>
    		</div>
    <hr class="remove-bottom remove-top">
    		<br />
    <h4>Recommended for you</h4>
        <?php
        //to show four random post thumbs
        $thumb_posts = new WP_Query(array(
        'post_type' => 'post',
        'ignore_sticky_posts' => 1,
        'posts_per_page' => 5,
        'meta_key' => '_thumbnail_id',
        'orderby' => 'rand' ));
        if($thumb_posts->have_posts()) : ?>
        <div id="relatedpostthumb">
        <?php while($thumb_posts->have_posts()): $thumb_posts->the_post();
        echo '<a href="' . get_permalink($post->ID) . '">' . get_the_post_thumbnail($post->ID,array(109,50)) . '</a>';
        endwhile; ?>
        </div>
        <?php endif;
        wp_reset_postdata();
        ?>
    
    </article>
    
    <?php comments_template(); ?>
    <?php endwhile; else: ?>
    
    		<h1 class="title">Not Found</h1>
    		<p><img src="<?php bloginfo('stylesheet_directory'); ?>/images/404.png"/></p>
    
    <?php endif; ?>
    
    </div>
    </div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I hope someone can help me, thank you in advance :)

  2. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    Have you asked the developer of your theme? These forums only provide theme-specific help for themes from here:

    http://wordpress.org/themes/

Reply

You must log in to post.

About this Topic