1. Support
  2. Knowledge Base
  3. FAQ
  4. Solving issues with ads and banners

Solving issues with ads and banners

Placing advertisements on your website is a great way to monetize your site and this can also be beneficial to give your website a professional touch. The majority of our WordPress themes offer several widget areas which you may use to display banners and ads in a well-organized way. If you are running online magazines or news websites you can integrate banners in an attractive and efficient manner which won’t disturb your website visitors. In case you are using banners or plan to display advertisements on your site but have issues in doing so, please have a look at our solutions to the most common issues that might occur when implementing ads and banners.

How to implement banners and ads on your website

To place regular image banners or script based advertisements (for example Google AdSense) on your website, you can make use of a default WordPress text widget, drop the widget into a suitable widget area and then insert the ad code (script) or basic HTML markup into the text widget to display the advertisement on your website as expected. The following example shows basic HTML code to add a regular image banner which is linked to a certain URL:

<a href="https://www.example.com/" target="_blank">
    <img src="https://www.example.com/ads/example-banner.jpg" alt="My Banner" />
</a>

Dependent on what kind of banners you are using and what kind of advertisement material you are working work with, your code will look different as this is just an example which isn’t functional. If you are not familiar with HTML basics, we can recommend online sources for beginners like for example w3schools. We also have created the following detailed tutorial on how to place ads and banners: How to place ads in your WordPress theme.

Where to place banners and advertisements on your website

Usually our WordPress themes offer several widget areas which you may use to place your text widgets including banners or ads as you prefer. Most commonly ads and banners are being placed in widget areas within the header, sidebar, footer, above and below articles or else. It is basically pretty much up to you where you want to display advertisements.

The popular MH Magazine theme also offers the possibility to globally place ads inside the article content or on archives – this is especially helpful if you are using Google AdSense which displays advertisements according to the related content for best results. To make use of these options, you can navigate to Appearance => Customize => Theme Options => Advertising in your WordPress dashboard and insert your ad codes as you prefer.

Placing advertisements on posts and archives of MH Magazine

In addition to the available widget locations, some of our WordPress themes (e.g. MH Magazine) offer options to automatically place ads inside the article content on all posts or on archives. The Content Ad on Posts location will display advertisements within your post content, floated to the top-left corner after the first paragraph. You can also override this advertisement on a per-post basis by inserting an advertisement code in the relevant Alternative Ad Code field when editing posts in the WordPress editor, or even disable the advertisement for that specific post only.

While making use of these advertising options, you can also display advertisements on archives where the ads will appear after every X posts, which you can define as you prefer. In case you need more information about the advertising options in the MH Magazine WordPress Theme, please see this tutorial: How to place ads in your WordPress theme.

In case you are using WordPress themes which do not offer such advertising options, you can still display ads and banners in your articles by simply pasting the ad codes manually into your article content within the WordPress text editor. When it comes to displaying ads on archives, this usually is only possible via custom development or suitable plugins, unless this is implemented in your theme.

Which advertisements and banner sizes can you use

As you can see in some of our WordPress theme demos we are displaying sizes for some sample ads (e.g. 336 x 380px or 300 x 250px). However, these are just examples of banner sizes which you may use for best results, but in the end this is completely up to you. Usually people make use of responsive ad units (e.g. Google AdSense) anyway and in that case the advertisements will automatically adapt based on the available width when viewing the site on different devices.

If you are in doubt regarding the optimal banner size, we would simply advise you to try certain banners and see if they fit the widget area you plan to use. Also make sure you are using responsive advertisements whenever possible, otherwise your ads might get cut off when being viewed on mobile devices. In case you’re using responsive Google AdSense ad units, it also might be necessary to modify the ad code so that your advertisements meet your personal requirements. Here you can find more information: How to modify your responsive ad code.

How to center ads and banners like in the theme demo

In our theme demos you can see that some advertisements and banners have a grey background applied and appear centered. This can be achieved by using some simple HTML markup: Just wrap your advertisement or HTML banner within a div-container and make use of the specific CSS class. For the MH Magazine theme, the CSS class would be mh-ad-spot, other themes may have other classes which you can find out by inspecting the elements on our demo sites via your browsers inspection tool. Wrapping your ad code within the div could look like this:

<div class="mh-ad-spot">
    <!-- Your Advertisement -->
</div>

How to display different or rotating ads on different pages

When placing advertisments within your regular sidebar, these ads will be shown on all posts, pages and archives. If you would like to display different advertisments for certain pages you could make use of plugins that allow to create custom sidebars, e.g. Custom Sidebars. As an alternative to different sidebars, you could also use plugins to automatically rotate or filter your advertisments, like for example the very popular AdRotate plugin with lots of functionality.

Common reasons why Google AdSense ads are not displaying

If you’ve placed Google AdSense ads on your website and in case these ads are not displaying as expected, please note that this can have several reasons and this usually isn’t affected by your WordPress theme. In general WordPress themes simply output your code exactly like you’ve added the code. That means if you insert your Google AdSense code into a default WordPress text widget, the theme will simply display whatever code you have added. Your WordPress theme itself does nothing that could affect the visibility of your advertisements.

Make sure you have added the Google AdSense ad code properly and ensure that you have valuable content on your website available as Google AdSense ads are highly content related and these ads might not always appear in case of inappropriate or low-quality content as definied by Google. In general it also might take up to a few hours before Google AdSense ads will show up – especially when it comes to new ad units – and Google doesn’t allow more than 3 banner ads per page.

Please also note that when you are using responsive Google AdSense ad units, it might be required to modify the ad code to meet your personal requirements (e.g. if Google displays ads in different sizes than perferred by you) or in case Google isn’t able to determine the available width of the parent HTML container in which you’ve placed the advertisement, which can especially be the case for floated elements. In case you need more information about modifying Google AdSense ad units, please have a look at this tutorial by Google: How to modify your responsive ad code.

If you’ve already tried everything (added valid ad code, modified responsive ad unit, checked if content is appropriate, etc…) and in case your Google AdSense ads still not appear as expected, then you might want to contact the Google AdSense support so that they can check your AdSense account and website, because this usually isn’t something that can be solved by your theme. Please also see our tutorial about Google AdSense which might help you understand Google AdSense better and solve your issue: How to add Google AdSense to your WordPress website.

You have not found a solution to your issue?

In case you have not found answers to your questions in this support article, please also take a look at our other support topics, as it is very likely that you will find your answer there. If you have purchased a WordPress theme by MH Themes and have a valid license to gain access to theme updates and support, then you may also send a support request for additional assistance.

Was this article helpful?

Related Articles

Stay in touch with us!

Join our newsletter and we let you know about new theme releases,
as well as important updates and discounts.

Latest news from our blog: How To Maximize Your WordPress Magazine Sidebar Design (11. January 2025)