Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Google AdSense support #404

Closed
gyandeeps opened this issue Jul 24, 2016 · 9 comments
Closed

Google AdSense support #404

gyandeeps opened this issue Jul 24, 2016 · 9 comments

Comments

@gyandeeps
Copy link

gyandeeps commented Jul 24, 2016

First, Thanks for the great web template. 👍

Based on the 3.3.3 release, I have been using this template on my website here
I can see the _config.yml file has a spot for google ad id information here but its not getting used any where.

Am i missing something here or is this functionality not available?

@gyandeeps gyandeeps changed the title Google ad support Google AdSense support Jul 24, 2016
@mmistakes
Copy link
Owner

mmistakes commented Jul 24, 2016

Nope you're not missing anything. Those were just placeholders that I didn't end up using and forgot to remove. Adsense works just fine without it. Simply copy/paste the script code Google gives you into a layout or include where you want it to appear.

For the theme's demo site I dropped it in right above the footer if you want to see a live example.

@gyandeeps
Copy link
Author

In the previous version, it used to put the ads for you. Do you think its should do it now also?

@mmistakes
Copy link
Owner

With this newer version there are custom head and footer includes so you can copy/paste in AdSense scripts (and other things).

I found that's more flexible. Simply take the script Google gives you after setting up your ad unit and paste it into footer/custom.html, in default.html layout (as I've done with the demo site), or anywhere else you'd prefer ads to appear.

If you check out the demo site (gh-pages branch) you can see how I handled it, using the responsive ad unit. These tend to work better with the theme since they adapt to various screen sizes (mobile, tablet, etc.) without overflowing the parent container.

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <div align="center" style="margin: 1em 0;">
    <ins class="adsbygoogle"
         style="display:block; border-bottom: initial;"
         data-ad-client="ca-pub-7328585512091257"
         data-ad-slot="3049671934"
         data-ad-format="auto"></ins>
    </div>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

@DeveloperPaul123
Copy link

@mmistakes Is this still the way to do it if you're using minimal mistakes as a remote theme?

@mmistakes
Copy link
Owner

@DeveloperPaul123 Yes.

@fredrikj31
Copy link

@mmistakes If I use the remote theme, how do I add content to the custom header file, when I have no access to the _layout folder when using the remote theme? Is there something I have missed?

@mmistakes
Copy link
Owner

@fredrikj31
Copy link

@fredrikj31 https://jekyllrb.com/docs/themes/#overriding-theme-defaults

Ohhh thanks. I think I had overseen that on the docs. Thanks a lot

@cortix
Copy link

cortix commented Dec 20, 2022

With this newer version there are custom head and footer includes so you can copy/paste in AdSense scripts (and other things).

I found that's more flexible. Simply take the script Google gives you after setting up your ad unit and paste it into footer/custom.html, in default.html layout (as I've done with the demo site), or anywhere else you'd prefer ads to appear.

If you check out the demo site (gh-pages branch) you can see how I handled it, using the responsive ad unit. These tend to work better with the theme since they adapt to various screen sizes (mobile, tablet, etc.) without overflowing the parent container.

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <div align="center" style="margin: 1em 0;">
    <ins class="adsbygoogle"
         style="display:block; border-bottom: initial;"
         data-ad-client="ca-pub-7328585512091257"
         data-ad-slot="3049671934"
         data-ad-format="auto"></ins>
    </div>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

When I tested my website on my old laptop(15.6 inc), I noticed that the design of the sidebar with the google ad was slightly distorted. When I remove the google ad from the sidebar, the problem goes away. I did what you said but the problem still persists. You can see the screenshots below.

I tested my website on google, safari and opera;

chrome : 108.0.5359.125 (64 bit)
firefox : 108.0.1 (64 bit)
opera: version 94.0.4606.38

hasancelik org-1
hasancelik org-2

koyumi0601 pushed a commit to koyumi0601/koyumi0601.github.io that referenced this issue Jul 31, 2023
Inhibit text-transform for code in h4
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants