Archived topic
Which hook to use before main content for "mobile devices"
9 replies · Started by Huseyin on February 5, 2021
Wondering how could I get AD placed here in mobile https://ibb.co/DbTN7r0 normally i use the generate_before_main_content hook. Where it works on desktop https://ibb.co/Q9VQ34s which hook do i need use for mobile devices?
Hi there,
you would use the same Hook.
Hooks are simply put; placeholders in the themes templates, and that template is used regardless of the device size.
thanks for the reply,
I'm using the generate_before_main_content, however in mobile devices, i can't see the hook working, I find after the content. Please, could you heck the links I provided in the main post.
Thanks
If i remove this CSS you have in Customizer > Additional CSS:
@media (max-width: 767px) {
.ai-viewport-1 {
display: none !important;
}
}
then the advert is showing in the correct place.
The advert below the content is an auto placed advert - its positioned is controlled by your Googl adsense setup.
However, I don't have that CSS inserted.
Your CSS is still there, and as you can see, once the CSS is removed your ads shows up.
https://www.screencast.com/t/QNkDIN6I
Try to disable all the CSS you added to see if the problems still persists.
Let me know :)
Ohh I forgot to mention that I'm using Ad Inserter Pro plugin to display the ads using the hooks. https://ibb.co/5vFVq4x
So I think I need to contact plugin developer then. Because I don't have CSS inserted like that.
That might be where the CSS is coming from.
You could try to look into the plugin first to see if there's any settings for different devices.
Hope the issue is gonna be solved soon :)
Thanks Ying,
I will mark this thread as resolved, as its a problem with a plugin, not generatepress, I'm very sorry for wasting your time guys.
No worries :)