• Resolved SukanyaMukherjee

    (@sukanyamukherjee)


    Hi. Thanks for the awesome theme. My site, http://www.hexapolis.com, really does look great. If you head over to one of the post pages, you will see that I have an ad after the comments section. The thing is, I would like the ad to the displayed right after the post ends, that is before the related posts section. However, looking at the single.php, I found that the the file for Ridizain is quite different from that of other themes. Could you help me figure out where I should put my adsense code?

    And secondly, I am curious. Is there any updates coming? I would really like to continue using the theme, but its been quite a while since the last one.

    Thanks again.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter SukanyaMukherjee

    (@sukanyamukherjee)

    Hi, can anybody help me with this?

    Theme Author Brian Harris

    (@zgani)

    Hello Sukanya,

    The ad code would need to be placed around line 24 just below
    get_template_part( 'content', get_post_format() );

    As for updates – there will be an update coming soon – I need to work some things out in order to meet the new review guidelines first.

    Regards,
    Zulf

    Thread Starter SukanyaMukherjee

    (@sukanyamukherjee)

    Hi,

    I tried adding the ad code from line 24. But every time I tried doing that, none of my post pages would open. Basically, placing the ad code in the specified location is causing problems with my post pages. They don’t open at all. My homepage however is fine.

    If the end of the post position is tricky, is there a way to display the ad in the middle of the post?

    Thanks again.

    Theme Author Brian Harris

    (@zgani)

    That’s because you are not closing/opening the php tags before and after the ad code – your code should look like the following with the ad code in place of <!-- Place your ad code here -->

    ?>
    	<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    	<!-- Place your ad code here -->
    <?php

    Let me know how that goes,
    Zulf

    P.S. If you wish to place to ad in the middle of the post then the best option is to use a plugin as it is more tricky than the above approach.

    Thread Starter SukanyaMukherjee

    (@sukanyamukherjee)

    Thank you for the quick reply. Unfortunately, I am currently using plugins for related posts and also author box. The problem therefore is that to place the ad right at the end of the post content, I need to call the individual functions directly. I am having difficulty about the format in which I should call these functions( I am new at this) Basically, I need to add the following code, after the ad code:

    <?php
        if ( function_exists( 'get_author_bio_box' ) ) {
            echo get_author_bio_box();
        }
    ?>

    and

    <?php wp_related_posts()?>

    If I add these codes as they are, my post pages are not opening. So, if you could just help with the format, as to how I should open and close the php tags, that would be great.

    Thanks again for you help.

    Thread Starter SukanyaMukherjee

    (@sukanyamukherjee)

    Thank you for the quick reply. Unfortunately, I am currently using plugins for related posts and also author box. The problem therefore is that to place the ad right at the end of the post content, I need to call the individual functions directly. I am having difficulty about the format in which I should call these functions( I am new at this) Basically, I need to add the following code, after the ad code:

    <?php
        if ( function_exists( 'get_author_bio_box' ) ) {
            echo get_author_bio_box();
        }
    ?>

    and

    <?php wp_related_posts()?>

    If I add these codes as they are, my post pages are not opening. So, if you could just help with the format, as to how I should open and close the php tags, that would be great.

    Thanks again for you help.

    Thread Starter SukanyaMukherjee

    (@sukanyamukherjee)

    Anyway I figured it out. Thank you for your help and also for the great theme.

    Theme Author Brian Harris

    (@zgani)

    Glad you figured it out and you are most welcome on the theme.

    I was in the process of posting a gist for the solution when posted your code – here’s the link for the benefit of others 🙂

    https://gist.github.com/zulfnore/201d5cb82fc07809316b

    Regards,
    Zulf

    Thread Starter SukanyaMukherjee

    (@sukanyamukherjee)

    Sorry to bother you, but is there a way I can shift the ad a bit to the right? I have noticed that in bigger screens, the left border of the ad sometimes gets cut off. Plus the ‘R’ in Related also gets cropped out.I have attached a screenshot.

    http://tinypic.com/r/rcsft3/8

    Thanks.

    Theme Author Brian Harris

    (@zgani)

    You’d probably need to wrap your code in a div class and then control the div with some css – something like

    <div class="myad">
    <!-- ad code here -->
    </div>

    CSS:

    .myad {
      margin-left: 40px;
    }

    OR:

    .myad {
      margin: 0 auto;
    }

    Same would apply for the related posts but here you can target the related posts plugin’s own css.

    Thread Starter SukanyaMukherjee

    (@sukanyamukherjee)

    Ok. I guess I will try doing that. Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Query about ad placement.’ is closed to new replies.