-
AuthorPosts
-
October 24, 2014 at 10:07 pm #340798
Hi guys, first let me congratulate you for this excellent theme! :)
Could you please advice on how to add an ad on the header? I am using the Logo left, Menu below settings and I’d like an Ad to the right (and below logo on mobile and tablets). Any tips?
Thanks and keep it up!
October 27, 2014 at 12:46 am #341215Hey soyelguillo!
Thank you for using Enfold.
Please try this hook code on functions.php:
function put_stuff_on_header() { ?> CONTENT HERE <?php } add_action('ava_main_header', 'put_stuff_on_header');
Best regards,
IsmaelOctober 27, 2014 at 5:24 am #341332Thank you for your reply Ismael, much appreciated. Unfortunately, I need a little more help, since I hooked the code on functions.php but I need the Ad to be aligned with the logo. Logo to the left, and the Ad to the right. When responsive to mobile, the Ad should move below main logo. Ad size is equivalent to the size of logo.
I know this is maybe a bit too much to ask, but you’d make my day! I am a big fan of Enfold since most content is drag and drop. I am willing to pay for this, since it’s very very urgent! Please advice
Muchas gracias!
This is the code I have used so far:
function ad_header() { ?> <div style="float: right; clear: none; margin-top: 50px; margin-right: 50px;" ><img src="http://cop20.lamulti.media/wp-content/uploads/2014/10/logo-stimulus-web.png" class="logostimulus" > </div> <?php } add_action('ava_main_header', 'ad_header');
But look how it looks :( http://cop20.lamulti.media/
- This reply was modified 10 years, 2 months ago by soyelguillo.
October 27, 2014 at 8:00 pm #341729Hey!
Please remove “style=”float: right; clear: none; margin-top: 50px; margin-right: 50px;”” and add ” class=”my-custom-ad” ” instead and then add following code to Quick CSS in Enfold theme options under General Styling tab
.my-custom-ad { margin-right: 50px; position: absolute; right: 0; bottom: 27%; }
Regards,
YigitOctober 27, 2014 at 9:17 pm #341795Thanks Yigit, that seems to be working only on big screens. Any ideas how to make it responsive so the banner would go below main logo on small screens? You guys are pure rock’n roll :)
October 27, 2014 at 9:28 pm #341799Hi!
Add this to Quick CSS:
@media only screen and (max-width: 767px) { .my-custom-ad { position: absolute; right: auto; bottom: auto; top: 80px; background: white; width: 100%; padding: 0 50px; } }
Best regards,
JosueOctober 27, 2014 at 11:57 pm #341858That is awesome support!
Since it’s an ad, I which to insert a link to the image. This is the code I have used, but not working:
function ad_header() { ?> <div class="my-custom-ad" ><a href="http://www.stimulus.com.pe" target="_blank"><img src="http://cop20.lamulti.media/wp-content/uploads/2014/10/logo-final-stimulus-ES.png" a href="http://www.stimulus.com.pe" target="_blank"></a> </div> <?php } add_action('ava_main_header', 'ad_header');
Also, and maybe this is too much to ask, I’d like the ad to be different in english and in spanish. I am using WPML plugin.
keep rockin’
October 28, 2014 at 12:22 am #341877Hey!
You need to change the ad z-index value, try something like 1000:
.my-custom-ad { z-index: 1000; }
Regarding showing a different ad depending on the language you can use the “ICL_LANGUAGE_CODE” constant, you’d need to modify the code to something like this:
function ad_header() { if(ICL_LANGUAGE_CODE == "es"){ ?> <div class="my-custom-ad" ><a href="http://www.stimulus.com.pe" target="_blank"><img src="http://cop20.lamulti.media/wp-content/uploads/2014/10/logo-final-stimulus-ES.png" a href="http://www.stimulus.com.pe" target="_blank"></a> </div> <?php }elseif(ICL_LANGUAGE_CODE == "en"){ ?> <div class="my-custom-ad" ><a href="http://www.stimulus.com.pe" target="_blank"><img src="http://cop20.lamulti.media/wp-content/uploads/2014/10/logo-final-stimulus-EN.png" a href="http://www.stimulus.com.pe" target="_blank"></a> </div> <?php } } add_action('ava_main_header', 'ad_header');
Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.