How do I add adsense to my singlepost.php? Please hlelp

Discussion in 'Blogging' started by mariek, Mar 19, 2012.

  1. #1
    I have a wordpress theme generated through Artisteer and no one can help me there. I just wanted to know how to insert adsense on my post via single.php?This is the single php code..please help..thanks!

    <?php


    /**
    *
    * single.php
    *
    * The single post template. Used when a single post is queried.
    *
    */


    get_header(); ?>
    <div class="art-layout-wrapper">
    <div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell art-sidebar1">
    <?php get_sidebar('default'); ?>
    <div class="cleared"></div>
    </div>
    <div class="art-layout-cell art-content">
    <?php get_sidebar('top'); ?>
    <?php
    if (have_posts()){
    /* Display navigation to next/previous posts when applicable */
    if (theme_get_option('theme_top_single_navigation')) {
    theme_page_navigation(
    array(
    'next_link' => theme_get_previous_post_link('&laquo; %link'),
    'prev_link' => theme_get_next_post_link('%link &raquo;')
    )
    );
    }

    while (have_posts())
    {
    the_post();
    get_template_part('content', 'single');
    /* Display comments */
    if ( theme_get_option('theme_allow_comments')) {
    comments_template();
    }
    }

    /* Display navigation to next/previous posts when applicable */
    if (theme_get_option('theme_bottom_single_navigation')) {
    theme_page_navigation(
    array(
    'next_link' => theme_get_previous_post_link('&laquo; %link'),
    'prev_link' => theme_get_next_post_link('%link &raquo;')
    )
    );
    }

    } else {

    theme_404_content();

    }
    ?>
    <?php get_sidebar('bottom'); ?>
    <div class="cleared"></div>
    </div>
    <div class="art-layout-cell art-sidebar2">
    <?php get_sidebar('secondary'); ?>
    <div class="cleared"></div>
    </div>
    </div>
    </div>
    </div>
    <div class="cleared"></div>
    <?php get_footer(); ?>
     
    mariek, Mar 19, 2012 IP
  2. rabbi1994

    rabbi1994 Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
  3. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #3
    adbox, Mar 20, 2012 IP
  4. mariek

    mariek Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks guys...I dont like to use any plugin...I prefer adding code to the single.php instead, just cant seem to figure it out with this theme, that's why I posted...so if anyone has coding knowledge, please help.
     
    mariek, Mar 20, 2012 IP
  5. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #5
    Do you want it above the post or below?
     
    adbox, Mar 20, 2012 IP
  6. mariek

    mariek Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I want it wrap around the text on the top right...I already have the code for that I just can't figure out which part to insert it in....
     
    mariek, Mar 20, 2012 IP
  7. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #7
    I believe you'll do this:

    
    while (have_posts()) 
    {
        the_post();
    
        /*INSERT ADVERTISEMENT CODE HERE*/
    
        get_template_part('content', 'single');
    
    
    PHP:
     
    adbox, Mar 21, 2012 IP
  8. adworder

    adworder Peon

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    that seams to be ok
     
    adworder, Mar 21, 2012 IP