Fix: Different size of Popup images on mobile

We provide the code snippets and content on this page without any guarantee or support. In most cases, these pages are created on requests or based on individual solutions sent to us by other users. After it was published, we are only reviewing the code and content when we are made aware of an issue. Please let us know if you find one.

Please only use the codes if you understand them and know how to add custom code to your WordPress site.

If you are using an image inside a group attached to a popup or sticky placement the size of the image could be smaller on mobile devices compared to the same image which is not inside a group. You can fix this by adding custom CSS to your popup or sticky placement wrapper

.PREFIX-layer {
    width: fit-content;
}

In most cases, it makes sense to add the custom CSS only on smaller display widths, since the image is displayed properly on tablet and desktop devices.

@media screen and (max-width: 800px) {
    .PREFIX-layer {
        width: fit-content;
    }
}

The class attribute might be adjusted depending on the prefix option you set up in the general settings of Advanced Ads. PREFIX- is just the sample prefix and needs to be exchanged with the setting found in the ID prefix option in Advanced Ads > Settings > General > ID prefix.

To apply this customization to a specific popup placement and not to all popup placements, use .PREFIX-PLACEMENTNAME instead of .PREFIX-layer.

Make it better

Increase your ad management skills without spending more time.
Join over 150,000 publishers and AdOpts increasing their ad revenue.