Advertisement:

Author Topic: aurum theme need help with position responsive adsense  (Read 1498 times)

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
aurum theme need help with position responsive adsense
« on: February 26, 2015, 04:35:33 am »
hello and thank you for taking the time to look at my post  :)

i am a newbie and can just about pick out code from the different elements on my page but i am willing to learn and cant put osclass down since i installed it.

my problem is the adsense responsive banner . i want the banner to stay in position .

with this code i can keep the banner off my site-bar and in the free area in the header (in red)

Quote
<!-- container -->
<?php if( osc_get_preference('header-728x90', 'aurum') != '') {?>
<div class="block_logo_and_adsense">   
        <div id="site_bar" style="border-bottom:2px solid #36465c;padding:10px 10px;">   
        <div class="container_totop">
                <section style="z-index:99999;position: absolute;">
                    <a id="showLeft"><img src="<?php echo osc_base_url();?>oc-content/themes/aurum/images/menu.png" style="padding-bottom:1px;padding-top:1px;"></img></a>
                </section>
        </div>       
        <div class="container">
            <div class="logo_header"style="float:left;">
            <a id="logo" href="<?php echo osc_base_url(); ?>"><?php echo logo_header(); ?></a>
            </div>
        </div>
        <div class="top-banner_header">   
        <div class="container"style="text-align:center;color:#fff;background:#2c3e50;padding:5px 10px;">
        <!-- header ad 728x60-->
        <div style="width:72%; display: inline-block">
        <?php echo osc_get_preference('header-728x90', 'aurum') ; ?>
        </div>
        <!-- /header ad 728x60-->       
       
        </div>
        </div>
        </div>
</div>
<?php } ?>   
Quote

which has my home page looking like this at 1366 res which is the way i like and would like to keep it .

img 1
http://aweegander.com/gallery/index.php/Capture2

but when i change resolutions the ad just doesnt look right especially @ 350px

the code in red is code i had added to to keep the responsive adsense above the site-bar but when removed it looks like this

img2
http://aweegander.com/gallery/index.php/capture1

i have tried my best to figure the positioning out by changing code in the header.php and in style.css with no real effect . i have also used the @media tags to get the ad to resize which it does but it  is not positioned right as i would like in the first picture. it hangs below the logo on the left

im sorry if this doesnt make sense but i am only using the terms i know as a newbie


all the best
chris
« Last Edit: February 28, 2015, 12:11:39 am by aweegander »

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: aurum theme need help with position responsive adsense
« Reply #1 on: February 27, 2015, 03:04:03 am »
i found a fix that works for me over at stackoverflow (thank you) . fully responsive adsense that stay in their place  :D

heres the code
Code: [Select]
<script type="text/javascript">


    var width = window.innerWidth
        || document.documentElement.clientWidth
        || document.body.clientWidth;

    google_ad_client = "ca-publisher-id";

    if (width > 1040) {
        // Activate the announcement "Leaderboard" 728x90 for widescreens
        google_ad_slot = "ad_slot";
        google_ad_width = 728;
        google_ad_height = 90;
    } else if ((width <= 1039) && (width > 890)) {
        // Activate the announcement "Banner" from 468x90 for Tablet and low res Computers
        google_ad_slot = "ad_slot";
        google_ad_width = 468;
        google_ad_height = 90;
    }else if ((width <= 889) && (width > 550)) {
        // Activate the announcement "Banner" from 468x90 for Tablet and low res Computers
        google_ad_slot = "ad_slot";
        google_ad_width = 350;
        google_ad_height = 90;
    } else if ((width <= 549) && (width > 355)) {
        //Enables Medium banner "Medium Rectangle"320x90 for medium (tablets)
        google_ad_slot = "ad_slot";
        google_ad_width = 320;
        google_ad_height = 90;
    }else if ((width <= 354) && (width > 240)) {
        //Enables small banner "Medium Rectangle" 225x90 for small phones
        google_ad_slot = "ad_slot";
        google_ad_width = 225;
        google_ad_height = 90;
    }

</script>

<script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

it is working a treat, the only thing is,some say over at stackoverflow. the code violates google tos. will have to double check  :)

thanks for reading

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: aurum theme need help with position responsive adsense
« Reply #2 on: February 27, 2015, 06:30:00 pm »
Hello Chris, sorry did not see your post before. Thank you for putting your question or problem.

I thought about adsense and your placements because the adsense codes are unresponsive, are still measures to be respected as well as rule by google. The google should have their codes according to all screen devices, maybe it might in the future be corrected in the best way.

If you need some help on other things on topic, you can contact me through e-mail, feel free to do so. Or new post, feel free.

Another thing, soon will be released a new update package for the theme aurum (Is surprise for now). I believe many people will love this new mechanism. I'm thinking of raising the price of the theme, but do not know if this can be possible. (taking into account the new mechanism, and taking into account the market osclass possible to change the price of the product). However who bought or buy before this new update soon, this case will be no cost to update the theme aurum.

I am very pleased with this new update in my computer, but have yet to finish a bit of code and send to osclass market on monday. After this it takes some time to be analyzed by osclass team, and if all ok, will be approved.

Spotted a problem with the drop-down menu categories (search and homepage). Just disable the administrator some categories or add new, and the design does not fit.

It's a problem I've ever fix in the new update, with new feature, where the administrator can control these values via dashboard. And this fix all the problem.

For now, you can do this manually as follows:

Open the style.css file, and on line 1563 to line 1570, you have to change the numbers of options, until you return to the correct positions of the main categories.

I see you changed the registration page, but something is wrong in your code. If you need assistance, contact me to email.

What I recommend to you:

- Wait until the new update packages are available.

Thereafter, implant your partly code, and test so forth. This is useful for you to go back on the code, if something may be wrong. You may not be able to find the problem if you implant all your own code, and take twice as long to find a problem unexpected. It's just a tip.  :)

Best wishes

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: aurum theme need help with position responsive adsense
« Reply #3 on: February 28, 2015, 12:53:17 am »
hello Fog  :) glad to have your assistance

i Don't fully understand what you are saying in the adsense part of your reply. are you saying that the code i am using is bad or that google will respect that code used until they can get it fixed?

just to clarify
i made a wee boo boo in my first post the second image http://aweegander.com/gallery/index.php/capture1 what you see in the picture is the responsive adsense working with @media tags and no red code  inserted that you can see in my first post

this is the image for responsive adsense and none of the red code inserted.just as you would insert it as a new theme http://aweegander.com/gallery/index.php/Capture3
as you can see the ad takes all of the nav site_bar. didnt know how to contain the adsense in the free space above until i found that javascript  :)

weyhey im glad to here theirs an update coming and a top secret one at that lol :D . to be honest i thought the support for this theme was dead as i haven't seen very many posts on the subject.i think i am going to start fresh with a child theme in place so i can keep my own setup . i am very new to all this but i dont think i am doing to bad with all the help and support from this forum and osclass documentation. i have all the wee bits of code that has helped me, saved for future reference.


the code in the registration that you see a problem with. have been added with the Required Fields at Registration plugin.  but as i write this i see their is an update for this plugin. hopefully that will fix the problem.

well i think i will take your advice and wait for the update. hold off on changing anymore code as i'm gonna have to do it all over again once updated. i think i will give my time into setting up a child theme for now 

thanks again for your support

Chris



fog

  • Hero Member
  • *****
  • Posts: 1062
Re: aurum theme need help with position responsive adsense
« Reply #4 on: February 28, 2015, 04:34:51 am »
Hello Chris, aurum is a premium theme approved by osclass team. Buyers will always have support and updates by the developer.

Returning to the subject that brought you to this topic, adsense is not responsive. I even understand why google has no interest in running ads on small screens, because there is not much space to make a full announcement (I mean full responsive).

Is there a way to make partially responsive adsense, respecting the various wide measures and adsense. Using "@media screen", reaching a width screen limit, there is a shift to new adsense code to meet the measure of current screen. (I hope my reasoning is not confused).

Por example, when the screen is 750px, the code adsense with fixed width of 728px is presente with this width. When the screen is 500px, the adsense code must be less than this value, and so on.

Basically it's what you have in your javascript code, but it does not work, or does the exchange (I tested this on your website to a few minutes ago).

As I said before, this is possible to do, but with html tags with responsive css to meet the various measures available fixed adsense offers.

I will include this feature in the update package. You then only have to insert the adsense codes via admin, within a accordion to not get too long.

Greetings

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: aurum theme need help with position responsive adsense
« Reply #5 on: February 28, 2015, 05:39:36 am »
Hello Fog

thank you for the reassurance and for your explanation.

 i see what you mean by the responsive ads on my site . they only seem to work when they feel like it . i had a large banner @360px then i had refresh a couple of times  to get the ad size i had requested in the script.

 i look forward to your update even more :D

all the best
Chris


fog

  • Hero Member
  • *****
  • Posts: 1062
Re: aurum theme need help with position responsive adsense
« Reply #6 on: February 28, 2015, 06:58:36 am »
Hi Chris, now I see your site again and it works good with that javascript code.
I test it before with chrome and an extension block the adsense.
Thank you for share this solution for adsense   :)
All the best
fog

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: aurum theme need help with position responsive adsense
« Reply #7 on: February 28, 2015, 08:37:29 pm »
Hey  :)

I don't deserved the credit, its coders like yourself and all the team here and a big thank you To stackoverflow  :D

Maybe one day I can take the credit lol need to keep the down though :D

But thank you
Chris