Support » Themes and Templates » Add an Ad to the left of every post, without sidebar

  • 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:

    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 type="text/javascript"
    <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 class="entry">
    		<div id="newprevbutton" style="float:left">
            <?php previous_post_link('%link','<img id="newprevbutton" src = "">'); ?></a>
    		<div id="newnextbutton" style="float:right;" >
            <?php next_post_link('%link','<img id="newnextbutton" src = "">'); ?></a>
    <?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')); ?>
    <hr class="remove-bottom">
    		<div id="prevbutton1" style="float:left">
            <?php previous_post_link('%link','<img id="blueprevious" src = "" style="margin:0;">'); ?></a>
    		<div class="random" style="float:left">
    		<a href="<?php bloginfo('siteurl');?>/index.php?random=1" border="0"><img src="" alt="Random Image" /></a>
    		<div id="nextbutton1" style="float:right;" >
            <?php next_post_link('%link','<img id="blueprevious" src = "" style="margin:0;">'); ?></a>
    <hr class="remove-bottom remove-top">
    		<br />
    <h4>Recommended for you</h4>
        //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; ?>
        <?php endif;
    <?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; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I hope someone can help me, thank you in advance ๐Ÿ™‚

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add an Ad to the left of every post, without sidebar’ is closed to new replies.