Viewing 28 posts - 1 through 28 (of 28 total)
  • Author
    Posts
  • #311980

    Is there some way to insert a banner, image or written text into the main header to fill some of the empty space opposite the logo? I thought I could insert a widget but there is no header option in the widgets. Any assistance would be much appreciated!

    http://tangerinefox.com/landscapemate/

    • This topic was modified 10 years, 3 months ago by Josue.
    #312111

    Hey pachanights!

    Thank you for using Enfold.

    You can use this on functions.php if you want to insert an extra element anywhere on the header:

     function ava_extra_header_element() { ?>
    ADD ANY CONTENT HERE!
    <?php }
    
    add_action('ava_main_header', 'ava_extra_header_element');

    Cheers!
    Ismael

    #312176

    I not see this text in this file

    #312212

    Hi!


    @alexrvs
    Can you post the link to your website please?

    Cheers!
    Yigit

    #312380

    I don’t see this code in the functions.php file either, unless I’m looking at the wrong one. Whats the path to be sure?

    I was hoping to be able to add something into the the quick css to give the same result. Is this possible?

    #312386

    Hey!

    You should go to Appearance > Editor and open functions.php file and add the code Ismael posted and change “ADD ANY CONTENT HERE!” with HTML code of your content as following

     function ava_extra_header_element() { ?>
    <div class='my-custom-content'>Here goes my text!</div>
    <?php }
    
    add_action('ava_main_header', 'ava_extra_header_element');

    Regards,
    Yigit

    #312439

    Ahh! thank you for explaining, and for the code. I’ve got it working now

    #312440

    One last question….is there something I can add to the custom css to allow me to change the position, font size, colour etc?

    #312446

    Hi!

    Please add following code to Quick CSS and adjust as needed

    .my-custom-content { position: relative; left: 50px; color: red; font-size: 18px; }

    Cheers!
    Yigit

    #312469

    novaproject.ru

    #312475

    Help!!!! can’t understand where to insert this code, put in one place and the text appeared above the logo and not the right of it

    1111

    #312481

    Thank you Yigit! Brilliant help, as always :)

    #312484

    functions.php show me place

    EDITED //

    #312518

    Hi!


    @pachanights
    You are welcome :)

    @alexrvs
    after adding the code to Functions.php file you should adjust its position using the code i posted here – https://kriesi.at/support/topic/display-a-banner-or-written-info-in-header/#post-312446

    Cheers!
    Yigit

    #312628

    if I could do it I would not have to ask the questions what and how

    #312633

    ok i now try? read text about position: relative may be i can

    #312639

    first step

    #312642

    Tell me it may be easier to disable the cap ? and instead collect of the blocks that I need ? I tried to disable the cap but this changes the width of the website on full

    #312644

    Hi!

    Thank you for the update.

    Please replace the css snippet with this:

    .my-custom-content {
    position: absolute;
    left: 330px;
    top: 20px;
    color: red;
    font-size: 18px;
    }
    
    .header-scrolled .my-custom-content {
    display: none;
    }

    Cheers!
    Ismael

    #312645

    not good

    #312650

    2 step add in extra info

    #312655

    3 step

    #312657

    now good 1

    scrool down 2

    #312659

    small windows

    #312669

    i make

    position: absolute;
    left: 30%;
    top: 3%;

    but now need make and small font in small window

    #313224

    Hi,
    This was perfectly just on time support. I was about to ask the same question on how to get text into the header. Thanks to your superb help/advice it works like a dream. Great!

    A question though. If I have a bilingual site, how will I get different language versions? I am planning on using WPML. Will that solve my problem, since the text is in the functions.php file? Or is there any other way to do this so that it can be handled easily on a bilingual site?

    Cheers,
    Rainer

    #313900

    Hi!

    Probably the easiest solution would be to use the constant to check the current language. Use it like:

    
     function ava_extra_header_element() {
    $banner = "<div class='my-custom-content'>Here goes my text for the standard language!</div>";
    if(defined('ICL_SITEPRESS_VERSION') && defined('ICL_LANGUAGE_CODE')){
    if(ICL_LANGUAGE_CODE == "de") $banner = "<div class='my-custom-content'>Here goes my text for the German language!</div>";
    if(ICL_LANGUAGE_CODE == "en") $banner = "<div class='my-custom-content'>Here goes my text for the Spanish language!</div>";
    }
    }
    
    add_action('ava_main_header', 'ava_extra_header_element');
    

    Replace de and en with the language shortcode(s) of your “translated” language(s) and change the “Here goes my text for the German language!”, etc text strings accordingly. Then replace “Here goes my text for the standard language!” with the text/banner of your “main” language (i.e. English).
    Cheers!
    Peter

    #313938

    Thanks! I’ll try that when I start with the language versions.

    Rainer

Viewing 28 posts - 1 through 28 (of 28 total)
  • The topic ‘Insert a banner or written info into the header’ is closed to new replies.