Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi TheCrack. The easiest way to do this is to use theme dynamic sidebars.
    Basically the steps are:
    1. Create a new sidebar in the Theme Options > Sidebars; note the sidebar-id that you assign.
    2. In Appearance > Widgets, add a text widget to the new sidebar.
    3. Insert your ad code into the text widget.
    4. Modify your child theme single.php file to insert the sidebars, replacing “my-sidebar#” with the sidebar ids:

    Beginning of post:

    <div class="post-inner group">
    
    	<h1 class="post-title"><?php the_title(); ?></h1>
    	<p class="post-byline"><?php _e('by','hueman'); ?> <?php the_author_posts_link(); ?> &middot; <?php the_time(get_option('date_format')); ?></p>
    
    		<!-- add widget between author info and post -->
    		<?php dynamic_sidebar('my-sidebar1'); ?>
    
    	<?php if( get_post_format() ) { get_template_part('inc/post-formats'); } ?>
    
    	<div class="clear"></div>

    End of post:

    <?php endwhile; ?>
    
    <div class="clear"></div>
    
    	<!-- add widgets after the post before the tags -->
    	<?php dynamic_sidebar('my-sidebar2'); ?>
    	<?php dynamic_sidebar('my-sidebar3'); ?>
    
    <?php the_tags('<p class="post-tags"><span>'.__('Tags:','hueman').'</span> ','','</p>'); ?>
    
    <?php if ( ( ot_get_option( 'author-bio' ) != 'off' ) && get_the_author_meta( 'description' ) ): ?>
    Thread Starter TheCrack

    (@thecrack)

    All good, the only problem, the final ads appear me one below the other, and want to appear next to each other, how could fix it?

    Thank you very much bdrown.

    Greetings!

    I don’t have your site link so can’t check the element names but you might try putting a float:left on those two sidebars.

    Thread Starter TheCrack

    (@thecrack)

    This is my site.

    I think this will fix it,
    Add a clear div below the two sidebars and above the post-tags paragraph:

    <div class="clear"></div>

    Add this css:

    #text-21.widget {
      float: left;
      margin-right: 20px;
    }

    Let me know how that works.

    Thread Starter TheCrack

    (@thecrack)

    If you add the div, everything disappears below the page, the box of biography, which also you may also like, and what to leave a comment.

    The div I have not added if you add just the css dislodges appears biography box above ads.

    It can be solved in two ways:

    by changing in the css margin right a 26

    #text-21.widget {
      float: left;
      margin-right: 26px;
    }

    Leaving a space between the two sidebars and above the post-tags paragraph

    Thread Starter TheCrack

    (@thecrack)

    I just noticed a problem on mobile ads have not adjusted properly, are blunted.You can check from your mobile.
    My site.

    Did some testing and this seemed to fix it:

    Add a clear div between text-22 and post-tags

    <div class="clear"></div>

    Add this css:

    #text-22.widget {
      float: left;
    }
    Thread Starter TheCrack

    (@thecrack)

    I tell you, to see if I’m right.
    I created two ads at the end of post, me there was a problem at that time, which appeared to me one below the other, and wanted me to appreciate yourself next to each other. Solve it:

    Adding a clear div below the two sidebars and above the post-tags paragraph:

    <div class="clear"></div>

    Adding this css:

    #text-21.widget {
      float: left;
      margin-right: 20px;
    }

    Then I added this css, so you look good in the Mobil and untrimmed:

    #text-22.widget {
      float: left;
    }

    It would all this right?

    That should do it. I just checked your site on an iPad simulator and the ads were not trimmed. Then I checked it on an iPhone simulator and the ads stacked up in one column. Let me know if you see something different.

    Thread Starter TheCrack

    (@thecrack)

    It seems that now the ads at the end of the post look good on mobile, the problem is not if all you’ve added is fine, or could affect a bad way to the web.

    I’ve noticed that the announcement is now trimmed in mobile, is to the top of the post.

    Thread Starter TheCrack

    (@thecrack)

    Yes, the only ad that appears cut now, is to the beginning of each post, sometimes, when it is large.

    Thread Starter TheCrack

    (@thecrack)

    Any solution?

    I haven’t found a way to fix this using css. I did find this post on one of the threads I ran across:

    I’ve tried helping others with AdSense resizing problems before, and the problem is that the ads get output inside an iFrame. When you pick a particular ad format, you pick a specific size, and the iFrame code comes with the width & height attributes set. While you can override the size attributes for the iFrame by adding width & height CSS properties, you can’t touch the contents of the iFrame with CSS, since it reflects the contents of another site, so resizing the iFrame, e.g., making it smaller for a narrower view port, will generally cut off parts of the ad.

    This problem is more apparent in AdSense ads which have a wide, horizontal format which are intended to fit in the main content area of a page, rather than the vertical, tall thin ads which are intended to fit inside a sidebar. So if you do have the wider ads, I would consider switching to the vertical ones and putting them in a sidebar, or in a narrow widget area of the footer.

    I also found a couple of articles related to responsive Google ads; maybe one of them will help:
    How to Use Google AdSense Ads on Responsive Websites
    How to add Google AdSense Responsive Ads to WordPress

    Thread Starter TheCrack

    (@thecrack)

    Thank you bdbrown, I’ll keep looking for a solution.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Ad adsesnse ads’ is closed to new replies.