Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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!

    #341215

    Hey 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,
    Ismael

    #341332

    Thank 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/

    #341729

    Hey!

    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,
    Yigit

    #341795

    Thanks 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 :)

    #341799

    Hi!

    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,
    Josue

    #341858

    That 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’

    #341877

    Hey!

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.